diff options
author | Brad King <brad.king@kitware.com> | 2015-07-07 18:31:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-07-08 13:00:00 (GMT) |
commit | bb7eefe4dd4b1385b830ac0f784af883a3d91985 (patch) | |
tree | 55c846e7bb05db830fe52cb333957bd5e4583fde /Source/cmOutputConverter.cxx | |
parent | cedd6e65d22870524eaee1394f023cf001d56aff (diff) | |
download | CMake-bb7eefe4dd4b1385b830ac0f784af883a3d91985.zip CMake-bb7eefe4dd4b1385b830ac0f784af883a3d91985.tar.gz CMake-bb7eefe4dd4b1385b830ac0f784af883a3d91985.tar.bz2 |
cmOutputConverter: Adopt EscapeWindowsShellArgument method
Move it out of cmSystemTools and into cmOutputConverter.
Diffstat (limited to 'Source/cmOutputConverter.cxx')
-rw-r--r-- | Source/cmOutputConverter.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index b0a30a1..161a5b4 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -412,6 +412,26 @@ std::string cmOutputConverter::EscapeForCMake(const std::string& str) } //---------------------------------------------------------------------------- +std::string +cmOutputConverter::EscapeWindowsShellArgument(const char* arg, int shell_flags) +{ + char local_buffer[1024]; + char* buffer = local_buffer; + int size = cmsysSystem_Shell_GetArgumentSizeForWindows(arg, shell_flags); + if(size > 1024) + { + buffer = new char[size]; + } + cmsysSystem_Shell_GetArgumentForWindows(arg, buffer, shell_flags); + std::string result(buffer); + if(buffer != local_buffer) + { + delete [] buffer; + } + return result; +} + +//---------------------------------------------------------------------------- cmOutputConverter::FortranFormat cmOutputConverter::GetFortranFormat(const char* value) { |