[Pkg-javascript-commits] [node-shell-quote] 28/137: finally passing all the tests
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Aug 25 19:19:36 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-shell-quote.
commit efa408481db33993fce2a1dd3c15ffac0203fe4c
Author: James Halliday <mail at substack.net>
Date: Sun Apr 14 21:15:58 2013 -0700
finally passing all the tests
---
index.js | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/index.js b/index.js
index df95586..8b339c5 100644
--- a/index.js
+++ b/index.js
@@ -31,12 +31,14 @@ exports.parse = function parse (s, env) {
;
}
else return s
- .replace(/(^|[^\\])\$(\w+)/g, getVar)
- .replace(/(^|[^\\])\${(\w+)}/g, getVar)
- .replace(/(['"])((\\\1|[^\1])*?)\1/, function (s, q) {
- return parse(s, env);
+ .replace(/(['"])((\\\1|[^\1])*?)\1|[^'"]+/g, function (s, q) {
+ if (/^['"]/.test(s)) return parse(s, env);
+ return s
+ .replace(/(^|[^\\])\$(\w+)/g, getVar)
+ .replace(/(^|[^\\])\${(\w+)}/g, getVar)
+ .replace(/\\([ "'\\$`(){}!#&*|])/g, '$1')
+ ;
})
- .replace(/\\([ "'\\$`(){}!#&*|])/g, '$1')
;
});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-shell-quote.git
More information about the Pkg-javascript-commits
mailing list