We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9521e2d commit 99d1c1cCopy full SHA for 99d1c1c
lib/util/escape.js
@@ -18,12 +18,12 @@ function escapeArgument(arg, doubleEscapeMetaChars) {
18
19
// Sequence of backslashes followed by a double quote:
20
// double up all the backslashes and escape the double quote
21
- arg = arg.replace(/(\\*)"/g, '$1$1\\"');
+ arg = arg.replace(/(?=\\*?)"/g, '$1$1\\"');
22
23
// Sequence of backslashes followed by the end of the string
24
// (which will become a double quote later):
25
// double up all the backslashes
26
- arg = arg.replace(/(\\*)$/, '$1$1');
+ arg = arg.replace(/(?=\\*?)$/, '$1$1');
27
28
// All other backslashes occur literally
29
0 commit comments