Author: hpoussin Date: Fri Sep 28 14:46:10 2007 New Revision: 29274
URL: http://svn.reactos.org/svn/reactos?rev=29274&view=rev Log: Fix some corner cases when processing <include> elements in .rbuild files
Modified: trunk/reactos/tools/rbuild/include.cpp
Modified: trunk/reactos/tools/rbuild/include.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/include.cpp?re... ============================================================================== --- trunk/reactos/tools/rbuild/include.cpp (original) +++ trunk/reactos/tools/rbuild/include.cpp Fri Sep 28 14:46:10 2007 @@ -59,6 +59,7 @@ Include::ProcessXML () { DirectoryLocation root = SourceDirectory; + const Module *base = module;
string relative_path; const XMLAttribute* att = node->GetAttribute ( "base", false ); @@ -70,23 +71,24 @@ "'base' attribute illegal from global <include>" );
if ( att->value == project.name ) - { - relative_path = node->value; - } + base = NULL; else { - const Module* base = project.LocateModule ( att->value ); + base = project.LocateModule ( att->value ); if ( !base ) throw XMLInvalidBuildFileException ( node->location, "<include> attribute 'base' references non-existant project or module '%s'", att->value.c_str() ); root = GetDefaultDirectoryTree ( base ); + } + }
- relative_path = base->output->relative_path; - if ( node->value.length () > 0 && node->value != "." ) - relative_path += sSep + node->value; - } + if ( base ) + { + relative_path = base->output->relative_path; + if ( node->value.length () > 0 && node->value != "." ) + relative_path += sSep + node->value; } else relative_path = node->value;