summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2003-08-04 11:12:42 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2003-08-04 11:12:42 (GMT)
commitd86d2fdf12208d7dfad78c9606f146541e15edfc (patch)
treefe51a5f24c0992507adc8aa83f9bf83b830a05cc /Source/cmSystemTools.cxx
parent2c33b3db659970b098b76a8180ca4e4241ced1a5 (diff)
downloadCMake-d86d2fdf12208d7dfad78c9606f146541e15edfc.zip
CMake-d86d2fdf12208d7dfad78c9606f146541e15edfc.tar.gz
CMake-d86d2fdf12208d7dfad78c9606f146541e15edfc.tar.bz2
ENH: Fix argument parsing on UNIX with spaces
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 51ec308..c3540c0 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -308,7 +308,7 @@ bool cmSystemTools::RunSingleCommand(
std::vector<std::string> args;
std::string arg;
-
+
// Split the command into an argv array.
for(const char* c = command; *c;)
{
@@ -350,8 +350,20 @@ bool cmSystemTools::RunSingleCommand(
// Parse an unquoted argument.
while(*c && *c != ' ' && *c != '\t')
{
- arg.append(1, *c);
- ++c;
+ if(*c == '\\')
+ {
+ ++c;
+ if(*c)
+ {
+ arg.append(1, *c);
+ ++c;
+ }
+ }
+ else
+ {
+ arg.append(1, *c);
+ ++c;
+ }
}
args.push_back(arg);
}