From cc3887c462390019b4d2a3dc2261b9665960752c Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 30 Oct 2003 14:00:59 -0500 Subject: [PATCH] BUG#259: Do not double quote arguments if they are already quoted when writing DartTestfile.txt. --- Source/cmAddTestCommand.cxx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx index 5802779956..b3defb8454 100644 --- a/Source/cmAddTestCommand.cxx +++ b/Source/cmAddTestCommand.cxx @@ -67,18 +67,19 @@ void cmAddTestCommand::FinalPass() ++it; for (; it != m_Args.end(); ++it) { - if(it->find(" ") != std::string::npos) - { - fout << " \"" << *it << "\""; - } - else - { - fout << " " << *it; - } + if((it->find(" ") != std::string::npos) && + (*it->begin() != '"' || *(it->end()-1) != '"')) + { + fout << " \"" << *it << "\""; + } + else + { + fout << " " << *it; + } } fout << ")" << std::endl; fout.close(); - } + } return; }