Fix weird bug in Project::ResolveProperties(), which was modifying the string given...
authorHervé Poussineau <hpoussin@reactos.org>
Wed, 19 Sep 2007 12:06:39 +0000 (12:06 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Wed, 19 Sep 2007 12:06:39 +0000 (12:06 +0000)
svn path=/trunk/; revision=29104

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

index 039b4f2..759a1cd 100644 (file)
@@ -196,7 +196,7 @@ Project::LookupProperty ( const string& name ) const
 }
 
 string
-Project::ResolveNextProperty ( string& s ) const
+Project::ResolveNextProperty ( const string& s ) const
 {
        size_t i = s.find ( "${" );
        if ( i == string::npos )
@@ -215,7 +215,7 @@ Project::ResolveNextProperty ( string& s ) const
                        string propertyName = s.substr ( i + 2, propertyNameLength );
                        const Property* property = LookupProperty ( propertyName );
                        if ( property != NULL )
-                               return s.replace ( i, propertyNameLength + 3, property->value );
+                               return string ( s ).replace ( i, propertyNameLength + 3, property->value );
                }
        }
        return s;
index 49290cc..222bee8 100644 (file)
@@ -251,7 +251,7 @@ public:
        const std::string& GetProjectFilename () const;
        std::string ResolveProperties ( const std::string& s ) const;
 private:
-       std::string ResolveNextProperty ( std::string& s ) const;
+       std::string ResolveNextProperty ( const std::string& s ) const;
        const Property* LookupProperty ( const std::string& name ) const;
        void SetConfigurationOption ( char* s,
                                      std::string name,