chiark / gitweb /
Fix the "shellquote" command to work properly. The bugs in it ought not to have...
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 25 Oct 2013 15:55:05 +0000 (16:55 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 25 Oct 2013 15:55:05 +0000 (16:55 +0100)
debian/changelog
dgit

index ad20088095602ea2a2841b279d6fe40d3375e674..41374bb0e4e03898170dab957cca024fe6ad4aee 100644 (file)
@@ -6,6 +6,8 @@ dgit (0.17~experimental4) experimental; urgency=low
     order so that we use the correct Description (the _source one,
     not the one from sbuild which didn't get e.g. -v<version>).
   * Clarify the manpage's comments about orig tarballs.  Closes: #723605.
+  * Fix the "shellquote" command to work properly.  The bugs in it ought
+    not to have caused any real trouble in previous versions of 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, $_;