diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-08-04 15:48:18 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-08-04 15:48:18 (GMT) |
commit | 867f88a93f1b4c8f85e26c251f7f30de12595019 (patch) | |
tree | 64b54a57dfd9ae01dde397e0848953516b72f973 | |
parent | 4515c33d3252c886fc6f43d1ea5884ef4256263e (diff) | |
download | CMake-867f88a93f1b4c8f85e26c251f7f30de12595019.zip CMake-867f88a93f1b4c8f85e26c251f7f30de12595019.tar.gz CMake-867f88a93f1b4c8f85e26c251f7f30de12595019.tar.bz2 |
ENH: Improve paths on windows
-rw-r--r-- | Source/cmSystemTools.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 084c483..6c94027 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -309,6 +309,14 @@ bool cmSystemTools::RunSingleCommand( std::vector<std::string> args; std::string arg; + bool win_path = false; + + if ( command[0] != '/' && command[1] == ':' && command[2] == '\\' || + command[0] == '\"' && command[1] != '/' && command[2] == ':' && command[3] == '\\' || + command[0] == '\\' && command[1] == '\\') + { + win_path = true; + } // Split the command into an argv array. for(const char* c = command; *c;) { @@ -338,7 +346,7 @@ bool cmSystemTools::RunSingleCommand( // Parse an unquoted argument. while(*c && *c != ' ' && *c != '\t') { - if(*c == '\\') + if(*c == '\\' && !win_path) { ++c; if(*c) @@ -374,6 +382,7 @@ bool cmSystemTools::RunSingleCommand( { *output = ""; } + cmsysProcess* cp = cmsysProcess_New(); cmsysProcess_SetCommand(cp, &*argv.begin()); cmsysProcess_SetWorkingDirectory(cp, dir); |