From 7c2288dfd54b80a20c5de74de628c4b132bce7cc Mon Sep 17 00:00:00 2001 From: Nicholas Sinlock <92338908+nasinlock@users.noreply.github.com> Date: Wed, 25 Jan 2023 16:26:52 -0800 Subject: [PATCH] Update quote function to fix path separator regression (#2974) --- CHANGELOG.md | 1 + src/shlex.ts | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34ff99c11..36329516f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Bug Fixes: - Fix failed activation when using the `cmake.allowUnsupportedPresetsVersions` setting. [#2968](https://github.com/microsoft/vscode-cmake-tools/issues/2968) - Verify binary directories only if there are multiple sources. [#2963](https://github.com/microsoft/vscode-cmake-tools/issues/2963) +- Update quote function to fix path separator regression [#2974](https://github.com/microsoft/vscode-cmake-tools/pull/2974) ## 1.13.41 Bug Fixes: diff --git a/src/shlex.ts b/src/shlex.ts index 545fc0324..786f02689 100644 --- a/src/shlex.ts +++ b/src/shlex.ts @@ -77,11 +77,7 @@ export function quote(str: string, opt?: ShlexOptions): string { if (str === '') { return '""'; } - if (!/[\s]/g.test(str)) { - // Don't quote if the string doesn't have whitespace - return str; - } - if (/[^\w@%\-+=:,./|]/.test(str)) { + if (/[^\w@%\-+=:,./|><]/.test(str)) { str = str.replace(/"/g, '\\"'); return `"${str}"`; } else {