chiark / gitweb /
Dgit.pm: Call `confess' when shellquote gets an undef arg
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 18 Jan 2017 21:28:25 +0000 (21:28 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 18 Jan 2017 21:28:26 +0000 (21:28 +0000)
This can happen if a command (eg passed to debugcmd) has an undef
argument.  This turns an undefined warning into an explicit internal
error.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Debian/Dgit.pm
debian/changelog

index 5e0bbd5e63ce0b8f8ddac59b63bbd34476cb9d03..ba1c28801aba0acb77fced48bb8966a878dc8973 100644 (file)
@@ -137,6 +137,7 @@ sub messagequote ($) {
 sub shellquote {
     my @out;
     local $_;
+    defined or confess 'internal error' foreach @_;
     foreach my $a (@_) {
        $_ = $a;
        if (!length || m{[^-=_./:0-9a-z]}i) {
index 4754f17085eddbc68b075dae28aade76014824a4..7c2faacc0aed959d97620b821321ade39008aefc 100644 (file)
@@ -1,6 +1,9 @@
 dgit (3.6~) unstable; urgency=medium
 
-  * 
+  Minor improvements:
+  * Call `confess' to print a stack trace when we pass undef to
+    shellquote (eg as a result of debugcmd).  Turns an undefined
+    warning into an explicit internal error.
 
  --