From d86d2fdf12208d7dfad78c9606f146541e15edfc Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Mon, 4 Aug 2003 07:12:42 -0400 Subject: ENH: Fix argument parsing on UNIX with spaces --- Source/cmSystemTools.cxx | 18 +++++++++++++++--- 1 file 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 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); } -- cgit v0.12