Skip to content

Commit 144e1c2

Browse files
committed
revert windows path unescaping, fixes #37
1 parent c24f3aa commit 144e1c2

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

index.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ exports.quote = function (xs) {
1010
return '"' + s.replace(/(["\\$`!])/g, '\\$1') + '"';
1111
}
1212
else {
13-
s = String(s).replace(/([A-z]:)?([#!"$&'()*,:;<=>?@\[\\\]^`{|}])/g, '$1\\$2');
14-
15-
// unescape paths in windows
16-
s = s.replace(/\\\\/g, '\\')
17-
return s
13+
return String(s).replace(/([A-z]:)?([#!"$&'()*,:;<=>?@\[\\\]^`{|}])/g, '$1\\$2');
1814
}
1915
}).join(' ');
2016
};

test/quote.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ test('quote ops', function (t) {
3232
t.end();
3333
});
3434

35-
test('quote windows paths', function (t) {
35+
test('quote windows paths', { skip: 'breaking change, disabled until 2.x' }, function (t) {
3636
var path = 'C:\\projects\\node-shell-quote\\index.js'
3737

3838
t.equal(quote([path, 'b', 'c d']), 'C:\\projects\\node-shell-quote\\index.js b \'c d\'')

0 commit comments

Comments
 (0)