chiark / gitweb /
Fix the "shellquote" command to work properly. The bugs in it ought not to have...
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 254e3fbf5f588bc1f1bc6a7c20f41492cdd09ab2..d74dd85b681c32357628472a12b7291f11995e4a 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -312,7 +312,8 @@ sub shellquote {
     local $_;
     foreach my $a (@_) {
        $_ = $a;
-       if (s{['\\]}{\\$&}g || m{\s} || m{[^-_./0-9a-z]}i) {
+       if (m{[^-=_./0-9a-z]}i) {
+           s{['\\]}{'\\$&'}g;
            push @out, "'$_'";
        } else {
            push @out, $_;