[Pkg-javascript-commits] [node-shell-quote] 39/137: first part of op parsing works

Bastien Roucariès rouca at moszumanska.debian.org
Fri Aug 25 19:19:37 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 e6f91991fe437eae6b7e4f571843b3d48c746aeb
Author: James Halliday <mail at substack.net>
Date:   Mon May 13 02:45:56 2013 -0700

    first part of op parsing works
---
 index.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/index.js b/index.js
index e1e97ad..49f158f 100644
--- a/index.js
+++ b/index.js
@@ -13,7 +13,7 @@ exports.quote = function (xs) {
 };
 
 exports.parse = function parse (s, env) {
-    var chunker = /(['"])((\\\1|[^\1])*?)\1|(\\ |\S)+/g;
+    var chunker = /(['"])((\\\1|[^\1])*?)\1|(\\ |\S)+|([&|])/g;
     var match = s.match(chunker);
     if (!match) return [];
     if (!env) env = {};
@@ -32,6 +32,9 @@ exports.parse = function parse (s, env) {
                 .replace(/\\([ "'\\$`(){}!#&*|])/g, '$1')
             ;
         }
+        else if (/^[&|]$/.test(s)) {
+            return { op: s };
+        }
         else return s.replace(
             /(['"])((\\\1|[^\1])*?)\1|[^'"]+/g,
             function (s, q) {

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