- Add defaultPath global var and use it instead of creating Path objects all the...
authorAleksey Bragin <aleksey@reactos.org>
Fri, 26 Dec 2008 11:03:16 +0000 (11:03 +0000)
committerAleksey Bragin <aleksey@reactos.org>
Fri, 26 Dec 2008 11:03:16 +0000 (11:03 +0000)
svn path=/trunk/; revision=38352

reactos/tools/rbuild/module.cpp
reactos/tools/rbuild/project.cpp
reactos/tools/rbuild/rbuild.h

index 6f71b95..0eb620a 100644 (file)
@@ -161,9 +161,8 @@ NormalizeFilename ( const string& filename )
 {
        if ( filename == "" )
                return "";
-       Path path;
-       string normalizedPath = path.Fixup ( filename, true );
-       string relativeNormalizedPath = path.RelativeFromWorkingDirectory ( normalizedPath );
+       string normalizedPath = defaultPath.Fixup ( filename, true );
+       string relativeNormalizedPath = defaultPath.RelativeFromWorkingDirectory ( normalizedPath );
        return FixSeparator ( relativeNormalizedPath );
 }
 
index 8366ce9..7257424 100644 (file)
@@ -25,6 +25,8 @@
 using std::string;
 using std::vector;
 
+const Path defaultPath;
+
 /* static */ string
 Environment::GetVariable ( const string& name )
 {
@@ -259,8 +261,7 @@ Project::ExecuteInvocations ()
 void
 Project::ReadXml ()
 {
-       Path path;
-       head = XMLLoadFile ( xmlfile, path, xmlbuildfiles );
+       head = XMLLoadFile ( xmlfile, defaultPath, xmlbuildfiles );
        node = NULL;
        for ( size_t i = 0; i < head->subElements.size (); i++ )
        {
index 0d2d3be..bddbf81 100644 (file)
@@ -51,6 +51,7 @@ extern std::string sSep;
 extern std::string sBadSep;
 extern char cSep;
 extern char cBadSep;
+extern const Path defaultPath;
 
 #ifdef WIN32
 #define DEF_EXEPREFIX ""