diff options
author | Brad King <brad.king@kitware.com> | 2024-06-14 13:24:20 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-06-14 13:24:31 (GMT) |
commit | c10ac9e86c787e19918b7b52861855f00361d64b (patch) | |
tree | cba802d4e8efe1a973787e044152433fd7def337 /Source | |
parent | 5a37d2f7348a16bfae4862b6ba3391b61fd38c4c (diff) | |
parent | 9b672e8075553a981a12cda956fcfc189636f449 (diff) | |
download | CMake-c10ac9e86c787e19918b7b52861855f00361d64b.zip CMake-c10ac9e86c787e19918b7b52861855f00361d64b.tar.gz CMake-c10ac9e86c787e19918b7b52861855f00361d64b.tar.bz2 |
Merge topic 'vs-quote-semicolons' into release-3.30
9b672e8075 VS: Quote custom command arguments containing semicolons
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9597
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmOutputConverter.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index f4a8d0c..9aac273 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -450,7 +450,8 @@ bool cmOutputConverter::Shell_CharNeedsQuotes(char c, int flags) } } else { /* On Windows several special characters need quotes to preserve them. */ - if (Shell_CharNeedsQuotesOnWindows(c)) { + if (Shell_CharNeedsQuotesOnWindows(c) || + (c == ';' && (flags & Shell_Flag_VSIDE))) { return true; } } @@ -670,11 +671,8 @@ std::string cmOutputConverter::Shell_GetArgument(cm::string_view in, int flags) } } else if (*cit == ';') { if (flags & Shell_Flag_VSIDE) { - /* In a VS IDE a semicolon is written ";". If this is written - in an un-quoted argument it starts a quoted segment, - inserts the ; and ends the segment. If it is written in a - quoted argument it ends quoting, inserts the ; and restarts - quoting. Either way the ; is isolated. */ + /* In VS a semicolon is written `";"` inside a quoted argument. + It ends quoting, inserts the `;`, and restarts quoting. */ out += "\";\""; } else { /* Otherwise a semicolon is written just ;. */ |