Skip to content

Commit

Permalink
fix for escaped spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed May 18, 2012
1 parent c6ff3dc commit 669b616
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports.quote = function (xs) {
};

exports.parse = function (s) {
return s.match(/(['"])((\\\1|[^\1])*?)\1|\S+/g)
return s.match(/(['"])((\\\1|[^\1])*?)\1|(\\ |\S)+/g)
.map(function (s) {
if (/^'/.test(s)) {
return s
Expand All @@ -27,7 +27,7 @@ exports.parse = function (s) {
.replace(/\\(["'\\$`(){}!#&*|])/g, '$1');
;
}
else return s;
else return s.replace(/\\ /g, ' ');
})
;
};

0 comments on commit 669b616

Please sign in to comment.