cmMakefile: Replace two loops with std::replace.
This commit is contained in:
parent
470cff497b
commit
ee269f4f16
@ -1341,19 +1341,8 @@ void cmMakefile::AddDefineFlag(const char* flag, std::string& dflags)
|
|||||||
{
|
{
|
||||||
// remove any \n\r
|
// remove any \n\r
|
||||||
std::string ret = flag;
|
std::string ret = flag;
|
||||||
std::string::size_type pos = 0;
|
std::replace(ret.begin(), ret.end(), '\n', ' ');
|
||||||
while((pos = ret.find('\n', pos)) != std::string::npos)
|
std::replace(ret.begin(), ret.end(), '\r', ' ');
|
||||||
{
|
|
||||||
ret[pos] = ' ';
|
|
||||||
pos++;
|
|
||||||
}
|
|
||||||
pos = 0;
|
|
||||||
while((pos = ret.find('\r', pos)) != std::string::npos)
|
|
||||||
{
|
|
||||||
ret[pos] = ' ';
|
|
||||||
pos++;
|
|
||||||
}
|
|
||||||
|
|
||||||
dflags += " ";
|
dflags += " ";
|
||||||
dflags += ret;
|
dflags += ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user