BUG#259: ADD_TEST command generated in DartTestfile.txt now quotes/escapes all arguments.

This commit is contained in:
Brad King 2003-11-03 15:19:27 -05:00
parent f60e16f8ab
commit 5f30c8caac
1 changed files with 12 additions and 7 deletions

View File

@ -67,14 +67,19 @@ void cmAddTestCommand::FinalPass()
++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)
{
fout << " \"" << *it << "\"";
}
else
// Escape quotes and backslashes within arguments.
if((*c == '"') || (*c == '\\'))
{
fout << " " << *it;
fout << '\\';
}
fout << *c;
}
fout << "\"";
}
fout << ")" << std::endl;
fout.close();