Fix weird bug in Project::ResolveProperties(), which was modifying the string given in argument

svn path=/trunk/; revision=29104
This commit is contained in:
Hervé Poussineau 2007-09-19 12:06:39 +00:00
parent a756421600
commit a7a5e5a486
2 changed files with 3 additions and 3 deletions

View 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;

View 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,