BUG#259: ADD_TEST command generated in DartTestfile.txt now quotes/escapes all arguments.
This commit is contained in:
parent
f60e16f8ab
commit
5f30c8caac
|
@ -67,18 +67,23 @@ void cmAddTestCommand::FinalPass()
|
||||||
++it;
|
++it;
|
||||||
for (; it != m_Args.end(); ++it)
|
for (; it != m_Args.end(); ++it)
|
||||||
{
|
{
|
||||||
if(it->find(" ") != std::string::npos)
|
// Just double-quote all arguments so they are re-parsed
|
||||||
|
// correctly by the test system.
|
||||||
|
fout << " \"";
|
||||||
|
for(std::string::iterator c = it->begin(); c != it->end(); ++c)
|
||||||
|
{
|
||||||
|
// Escape quotes and backslashes within arguments.
|
||||||
|
if((*c == '"') || (*c == '\\'))
|
||||||
{
|
{
|
||||||
fout << " \"" << *it << "\"";
|
fout << '\\';
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fout << " " << *it;
|
|
||||||
}
|
}
|
||||||
|
fout << *c;
|
||||||
|
}
|
||||||
|
fout << "\"";
|
||||||
}
|
}
|
||||||
fout << ")" << std::endl;
|
fout << ")" << std::endl;
|
||||||
fout.close();
|
fout.close();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue