From a7a5e5a486ccbf1ef5acb21148470bcaf0567be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Wed, 19 Sep 2007 12:06:39 +0000 Subject: [PATCH] Fix weird bug in Project::ResolveProperties(), which was modifying the string given in argument svn path=/trunk/; revision=29104 --- reactos/tools/rbuild/project.cpp | 4 ++-- reactos/tools/rbuild/rbuild.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/tools/rbuild/project.cpp b/reactos/tools/rbuild/project.cpp index 039b4f2efc7..759a1cd7afb 100644 --- a/reactos/tools/rbuild/project.cpp +++ b/reactos/tools/rbuild/project.cpp @@ -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; diff --git a/reactos/tools/rbuild/rbuild.h b/reactos/tools/rbuild/rbuild.h index 49290ccf7b8..222bee83381 100644 --- a/reactos/tools/rbuild/rbuild.h +++ b/reactos/tools/rbuild/rbuild.h @@ -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,