From 4d5321f8916869e9c806cd8d58c4ede6d7a45766 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Mon, 26 Feb 2007 11:41:41 -0500 Subject: ENH: go back to EscapeForShell version --- Source/cmLocalGenerator.cxx | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 953a4f4..834fe10 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2066,21 +2066,6 @@ std::string cmLocalGenerator::Convert(const char* source, } if( output == SHELL) { - // for shell commands if force unix is on, but this->WindowsShell - // is true, then turn off force unix paths for the output path - // so that the path is windows style and will work with windows - // cmd.exe. - bool forceOn = cmSystemTools::GetForceUnixPaths(); - if(forceOn && this->WindowsShell) - { - cmSystemTools::SetForceUnixPaths(false); - } - result = cmSystemTools::ConvertToOutputPath(result.c_str()); - if(forceOn && this->WindowsShell) - { - cmSystemTools::SetForceUnixPaths(true); - } - // For the MSYS shell convert drive letters to posix paths, so // that c:/some/path becomes /c/some/path. This is needed to // avoid problems with the shell path translation. @@ -2092,19 +2077,20 @@ std::string cmLocalGenerator::Convert(const char* source, result[0] = '/'; } } - // if this is unix then we need to escape () in the shell -#if !defined(WIN32) || defined(CYGWIN) - forceOn = true; -#endif - if(forceOn ) + if(this->WindowsShell) { - result = cmSystemTools::EscapeForUnixShell(result); + std::string::size_type pos = 0; + while((pos = result.find('/', pos)) != std::string::npos) + { + result[pos] = '\\'; + pos++; + } } + result = this->EscapeForShell(result.c_str(), true, false); } return result; } - //---------------------------------------------------------------------------- void cmLocalGenerator -- cgit v0.12