summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx18
1 files changed, 6 insertions, 12 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index eea4986..c769154 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -824,18 +824,12 @@ bool cmSystemTools::RunSingleCommand(
std::string
cmSystemTools::PrintSingleCommand(std::vector<std::string> const& command)
{
- std::string commandStr;
- const char* sep = "";
- for(std::vector<std::string>::const_iterator i = command.begin();
- i != command.end(); ++i)
- {
- commandStr += sep;
- commandStr += "\"";
- commandStr += *i;
- commandStr += "\"";
- sep = " ";
- }
- return commandStr;
+ if (command.empty())
+ {
+ return std::string();
+ }
+
+ return "\"" + cmJoin(command, "\" \"") + "\"";
}
bool cmSystemTools::DoesFileExistWithExtensions(