diff options
author | Jim Miller <millerjv@crd.ge.com> | 2001-06-06 20:14:11 (GMT) |
---|---|---|
committer | Jim Miller <millerjv@crd.ge.com> | 2001-06-06 20:14:11 (GMT) |
commit | 090511748018049bb1eb0ea34f1ffad8b3563a72 (patch) | |
tree | f1e4bbdf2d1b607e2519f5d89a1a4b66d6fdcc32 /Source/cmAddTestCommand.cxx | |
parent | 37801ddaaec78597d5ac000bf60f6948ff865d06 (diff) | |
download | CMake-090511748018049bb1eb0ea34f1ffad8b3563a72.zip CMake-090511748018049bb1eb0ea34f1ffad8b3563a72.tar.gz CMake-090511748018049bb1eb0ea34f1ffad8b3563a72.tar.bz2 |
FIX: InitialPass() seg fault on std::copy and FinalPass() was not appending to the file
Diffstat (limited to 'Source/cmAddTestCommand.cxx')
-rw-r--r-- | Source/cmAddTestCommand.cxx | 7 |
1 files 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<std::string>& 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()); |