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
This commit is contained in:
Emily Marigold Klassen
2019-05-01 00:04:25 -07:00
committed by Remy Sharp
parent aa41ab2124
commit 2973afbd26

View File

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