diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-05-16 15:27:06 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-05-16 16:15:31 (GMT) |
commit | 81d45dabc4534f15b8c61935060cd4d10f258f15 (patch) | |
tree | e4656dc9464d264b4450720c8e90f275df6fb834 /Source/cmOutputConverter.cxx | |
parent | bafb6e999d41a2b613e3c92ade97025de9d2ca27 (diff) | |
download | CMake-81d45dabc4534f15b8c61935060cd4d10f258f15.zip CMake-81d45dabc4534f15b8c61935060cd4d10f258f15.tar.gz CMake-81d45dabc4534f15b8c61935060cd4d10f258f15.tar.bz2 |
cmOutputConverter: add a `static` version of `EscapeForShell`
Diffstat (limited to 'Source/cmOutputConverter.cxx')
-rw-r--r-- | Source/cmOutputConverter.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index 53cb21e..02981ae 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -243,11 +243,6 @@ std::string cmOutputConverter::EscapeForShell(cm::string_view str, bool unescapeNinjaConfiguration, bool forResponse) const { - // Do not escape shell operators. - if (cmOutputConverterIsShellOperator(str)) { - return std::string(str); - } - // Compute the flags for the target shell environment. int flags = 0; if (this->GetState()->UseWindowsVSIDE()) { @@ -283,6 +278,16 @@ std::string cmOutputConverter::EscapeForShell(cm::string_view str, flags |= Shell_Flag_IsUnix; } + return cmOutputConverter::EscapeForShell(str, flags); +} + +std::string cmOutputConverter::EscapeForShell(cm::string_view str, int flags) +{ + // Do not escape shell operators. + if (cmOutputConverterIsShellOperator(str)) { + return std::string(str); + } + return Shell_GetArgument(str, flags); } |