From 090511748018049bb1eb0ea34f1ffad8b3563a72 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Wed, 6 Jun 2001 16:14:11 -0400 Subject: FIX: InitialPass() seg fault on std::copy and FinalPass() was not appending to the file --- Source/cmAddTestCommand.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx index 1c12b32..9eb01d4 100644 --- a/Source/cmAddTestCommand.cxx +++ b/Source/cmAddTestCommand.cxx @@ -54,8 +54,9 @@ bool cmAddTestCommand::InitialPass(std::vector& args) return false; } - // store the aruments for the final pass - std::copy(args.begin(),args.end(),m_Args.begin()); + // store the arguments for the final pass + m_Args.erase(m_Args.begin(), m_Args.end()); + std::copy(args.begin(),args.end(),std::back_inserter(m_Args)); return true; } @@ -78,7 +79,7 @@ void cmAddTestCommand::FinalPass() fname += "CMakeTestfile.txt"; // Open the output Testfile - std::ofstream fout(fname.c_str()); + std::ofstream fout(fname.c_str(), std::ios_base::app); if (!fout) { cmSystemTools::Error("Error Writing ", fname.c_str()); -- cgit v0.12