From: Ian Jackson Date: Wed, 18 Jan 2017 21:28:25 +0000 (+0000) Subject: Dgit.pm: Call `confess' when shellquote gets an undef arg X-Git-Tag: archive/debian/3.6~8 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=48f5dab721e03a47deeef0af45a993b48687bf88 Dgit.pm: Call `confess' when shellquote gets an undef arg 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 --- diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index 5e0bbd5e..ba1c2880 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -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) { diff --git a/debian/changelog b/debian/changelog index 4754f170..7c2faacc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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. --