From 2973afbd26e2c9a9f9676fed8ab63999022ea7ca Mon Sep 17 00:00:00 2001 From: Emily Marigold Klassen Date: Wed, 1 May 2019 00:04:25 -0700 Subject: [PATCH] fix: Quote zero-length strings in arguments (#1551) If a zero-length string is passed, it does not get properly quoted, and then it is not properly passed to the child process --- lib/utils/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/index.js b/lib/utils/index.js index d49f8c5e..c4803383 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -69,7 +69,7 @@ var utils = (module.exports = { args.map(function (arg) { // if an argument contains a space, we want to show it with quotes // around it to indicate that it is a single argument - if (arg.indexOf(' ') === -1) { + if (arg.length > 0 && arg.indexOf(' ') === -1) { return arg; } // this should correctly escape nested quotes