chiark / gitweb /
Diagnostics: Make shellquote() print empty arguments as ''
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 2 May 2015 19:42:45 +0000 (20:42 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 31 May 2015 10:54:09 +0000 (11:54 +0100)
Debian/Dgit.pm

index e2a503d..f33b173 100644 (file)
@@ -107,7 +107,7 @@ sub shellquote {
     local $_;
     foreach my $a (@_) {
        $_ = $a;
-       if (m{[^-=_./0-9a-z]}i) {
+       if (!length || m{[^-=_./0-9a-z]}i) {
            s{['\\]}{'\\$&'}g;
            push @out, "'$_'";
        } else {