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