[Pkg-javascript-commits] [node-shell-quote] 112/137: Fix escaping for greater than and less than
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Aug 25 19:19:44 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 70e9eb2a854eb56a3dfa255be12610a722bbe080
Author: Jacob Waddell <jacob at Jacobs-Mac-mini.local>
Date: Fri May 20 10:48:00 2016 -0700
Fix escaping for greater than and less than
---
index.js | 2 +-
test/quote.js | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/index.js b/index.js
index 473b3d2..e3811e8 100644
--- a/index.js
+++ b/index.js
@@ -15,7 +15,7 @@ exports.quote = function (xs) {
return '"' + s.replace(/(["\\$`!])/g, '\\$1') + '"';
}
else {
- return String(s).replace(/([\\$`()!#&*|])/g, '\\$1');
+ return String(s).replace(/([\\$`()!#&*|><])/g, '\\$1');
}
}).join(' ');
};
diff --git a/test/quote.js b/test/quote.js
index 8f9c1b8..030ee74 100644
--- a/test/quote.js
+++ b/test/quote.js
@@ -17,6 +17,7 @@ test('quote', function (t) {
t.equal(quote(["'#(){}*|][!"]), '"\'#(){}*|][\\!"');
t.equal(quote(["X#(){}*|][!"]), "X\\#\\(\\){}\\*\\|][\\!");
t.equal(quote(["a\n#\nb"]), "'a\n#\nb'");
+ t.equal(quote(['><']), '\\>\\<');
t.equal(quote([ 'a', 1, true, false ]), 'a 1 true false');
t.equal(quote([ 'a', 1, null, undefined ]), 'a 1 null undefined');
t.end();
--
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