Skip to content

Commit

Permalink
properly quote empty arguments; fixes #25098
Browse files Browse the repository at this point in the history
  • Loading branch information
weinand committed Jun 12, 2019
1 parent 08bb5a1 commit fd05938
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vs/workbench/contrib/debug/node/terminals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export function prepareCommand(args: DebugProtocol.RunInTerminalRequestArguments

quote = (s: string) => {
s = s.replace(/\"/g, '""');
return (s.indexOf(' ') >= 0 || s.indexOf('"') >= 0) ? `"${s}"` : s;
return (s.indexOf(' ') >= 0 || s.indexOf('"') >= 0 || s.length === 0) ? `"${s}"` : s;
};

if (args.cwd) {
Expand Down Expand Up @@ -410,7 +410,7 @@ export function prepareCommand(args: DebugProtocol.RunInTerminalRequestArguments

quote = (s: string) => {
s = s.replace(/([\"\\])/g, '\\$1');
return s.indexOf(' ') >= 0 ? `"${s}"` : s;
return (s.indexOf(' ') >= 0 || s.length === 0) ? `"${s}"` : s;
};

const hardQuote = (s: string) => {
Expand Down

0 comments on commit fd05938

Please sign in to comment.