chiark / gitweb /
Diagnostics: Make shellquote() print empty arguments as ''
[dgit.git] / Debian / Dgit.pm
index e2a503d73eee9e5ae89f12b32d27e659963e426a..f33b173ca9bdac1424757b1d7c3adb022bda57da 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 {