From d4ddde19056d604fadf338e5d2dcc5ec3aee0943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Fri, 28 Sep 2007 10:46:10 +0000 Subject: [PATCH] Fix some corner cases when processing elements in .rbuild files svn path=/trunk/; revision=29274 --- reactos/tools/rbuild/include.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/reactos/tools/rbuild/include.cpp b/reactos/tools/rbuild/include.cpp index ec4a7cadb23..0a952ecbd46 100644 --- a/reactos/tools/rbuild/include.cpp +++ b/reactos/tools/rbuild/include.cpp @@ -59,6 +59,7 @@ void Include::ProcessXML () { DirectoryLocation root = SourceDirectory; + const Module *base = module; string relative_path; const XMLAttribute* att = node->GetAttribute ( "base", false ); @@ -70,24 +71,25 @@ Include::ProcessXML () "'base' attribute illegal from global " ); 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, " 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;