summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-01-25 14:53:20 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-02-11 21:58:04 (GMT)
commit9380e85f865e29cd5968e91408a31d5160f4a4cb (patch)
treed2ef6fa191ac4d71df76bd621af169b642e07ebc /Source/cmcmd.cxx
parentbb10012fea677fd8aa1bbefd06061efcb7ec1955 (diff)
downloadCMake-9380e85f865e29cd5968e91408a31d5160f4a4cb.zip
CMake-9380e85f865e29cd5968e91408a31d5160f4a4cb.tar.gz
CMake-9380e85f865e29cd5968e91408a31d5160f4a4cb.tar.bz2
Convert loops to cmJoin algorithm with cmRange.
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r--Source/cmcmd.cxx15
1 files changed, 2 insertions, 13 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 5260cb0..5c93975 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -406,12 +406,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// Clock command
else if (args[1] == "time" && args.size() > 2)
{
- std::string command = args[2];
- for (std::string::size_type cc = 3; cc < args.size(); cc ++)
- {
- command += " ";
- command += args[cc];
- }
+ std::string command = cmJoin(cmRange(args).advance(2), " ");
clock_t clock_start, clock_finish;
time_t time_start, time_finish;
@@ -473,14 +468,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
}
std::string command = "\"";
- command += args[3];
+ command += cmJoin(cmRange(args).advance(3), "\" \"");
command += "\"";
- for (std::string::size_type cc = 4; cc < args.size(); cc ++)
- {
- command += " \"";
- command += args[cc];
- command += "\"";
- }
int retval = 0;
int timeout = 0;
if ( cmSystemTools::RunSingleCommand(command.c_str(), 0, &retval,