提交 2546d53a 编写于 作者: D Dirk Baeumer

Fixes #50131: Task with escaped double quote now fails due to improper evaluation

上级 b217a7f2
......@@ -15,19 +15,19 @@ import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
export enum ShellQuoting {
/**
* Default is character escaping.
* Use character escaping.
*/
Escape = 1,
/**
* Default is strong quoting
* Use strong quoting
*/
Strong = 2,
/**
* Default is weak quoting.
* Use weak quoting.
*/
Weak = 3
Weak = 3,
}
export namespace ShellQuoting {
......
......@@ -649,8 +649,21 @@ export class TerminalTaskSystem implements ITaskSystem {
return false;
}
}
let quote: string;
for (let i = 0; i < value.length; i++) {
if (value[i] === ' ' && value[i - 1] !== shellQuoteOptions.escape) {
// We found the end quote.
let ch = value[i];
if (ch === quote) {
quote = undefined;
} else if (quote !== void 0) {
// skip the character. We are quoted.
continue;
} else if (ch === shellQuoteOptions.escape) {
// Skip the next character
i++;
} else if (ch === shellQuoteOptions.strong || ch === shellQuoteOptions.weak) {
quote = ch;
} else if (ch === ' ') {
return true;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册