[Pkg-javascript-commits] [node-shell-quote] 47/137: now passing all the single-char op tests
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Aug 25 19:19:38 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 e3e9ac17ef02300bad7f4faefee5c7a993b3bc97
Author: James Halliday <mail at substack.net>
Date: Mon May 13 03:12:40 2013 -0700
now passing all the single-char op tests
---
index.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/index.js b/index.js
index 66d9185..774f9d8 100644
--- a/index.js
+++ b/index.js
@@ -15,12 +15,12 @@ exports.quote = function (xs) {
var CONTROL = '(?:' + [
'\\|\\|', '\\&\\&', ';;', '\\|\\&', '[&;()|]'
].join('|') + ')';
-var META = '[|&;()<> \\t]';
+var META = '|&;()<> \\t';
exports.parse = function parse (s, env) {
var chunker = new RegExp([
'([\'"])((\\\\\\1|[^\\1])*?)\\1', // quotes
- '(\\\\' + META + '|[^\\s&|])+', // barewords
+ '(\\\\[' + META + ']|[^\\s' + META + '])+', // barewords
'(' + CONTROL + ')' // control chars
].join('|'), 'g');
var match = s.match(chunker);
@@ -41,7 +41,7 @@ exports.parse = function parse (s, env) {
.replace(/\\([ "'\\$`(){}!#&*|])/g, '$1')
;
}
- else if (/^[&|]$/.test(s)) {
+ else if (RegExp('^[' + META + ']$').test(s)) {
return { op: s };
}
else return s.replace(
--
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