BUG: make sure flag is found even with extra spaces at the start

This commit is contained in:
Bill Hoffman 2008-09-11 14:50:38 -04:00
parent bd1935dcd1
commit 7ac6912d5e

View File

@ -1017,7 +1017,7 @@ std::string cmGlobalXCodeGenerator::ExtractFlag(const char* flag,
{ {
std::string retFlag; std::string retFlag;
std::string::size_type pos = flags.find(flag); std::string::size_type pos = flags.find(flag);
if(pos != flags.npos && (pos ==0 || flags[pos]==' ')) if(pos != flags.npos && (pos ==0 || flags[pos-1]==' '))
{ {
while(pos < flags.size() && flags[pos] != ' ') while(pos < flags.size() && flags[pos] != ' ')
{ {