Skip to content

Commit 2973afb

Browse files
forivallremy
authored andcommitted
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
1 parent aa41ab2 commit 2973afb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/utils/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ var utils = (module.exports = {
6969
args.map(function (arg) {
7070
// if an argument contains a space, we want to show it with quotes
7171
// around it to indicate that it is a single argument
72-
if (arg.indexOf(' ') === -1) {
72+
if (arg.length > 0 && arg.indexOf(' ') === -1) {
7373
return arg;
7474
}
7575
// this should correctly escape nested quotes

0 commit comments

Comments
 (0)