[Pkg-javascript-commits] [node-shell-quote] 45/137: using the control ops directly from the docs

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 f53598732ba606c7bca66fd7d55d809544c452cf
Author: James Halliday <mail at substack.net>
Date:   Mon May 13 03:06:38 2013 -0700

    using the control ops directly from the docs
---
 index.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index 22cbf14..66d9185 100644
--- a/index.js
+++ b/index.js
@@ -12,14 +12,16 @@ exports.quote = function (xs) {
     }).join(' ');
 };
 
-var CONTROL = '(?:\\|\\||\\&\\&|;;|\\|\\&[&;()|])';
+var CONTROL = '(?:' + [
+    '\\|\\|', '\\&\\&', ';;', '\\|\\&', '[&;()|]'
+].join('|') + ')';
 var META = '[|&;()<> \\t]';
 
 exports.parse = function parse (s, env) {
     var chunker = new RegExp([
         '([\'"])((\\\\\\1|[^\\1])*?)\\1', // quotes
         '(\\\\' + META + '|[^\\s&|])+', // barewords
-        '([&|])' // control chars
+        '(' + CONTROL + ')' // control chars
     ].join('|'), 'g');
     var match = s.match(chunker);
     if (!match) return [];

-- 
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