From: Ian Jackson Date: Sun, 31 Jul 2016 17:12:59 +0000 (+0100) Subject: Dgit.pm: cmdoutput: Handle undef in arg crash better X-Git-Tag: archive/debian/2.0~254 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;ds=inline;h=b5f605a1e7d6a92c07636b378deb74e895b0967e;p=dgit.git Dgit.pm: cmdoutput: Handle undef in arg crash better Use `confess' which produces a stack trace. And don't forget to use Data::Dumper; Bug introduced in e6ce71a87a1c "Move various useful functions into Dgit.pm [...]". Signed-off-by: Ian Jackson --- diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index aa0c5a3d..cb4a599b 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -5,10 +5,12 @@ package Debian::Dgit; use strict; use warnings; +use Carp; use POSIX; use IO::Handle; use Config; use Digest::SHA; +use Data::Dumper; BEGIN { use Exporter (); @@ -208,7 +210,7 @@ sub failedcmd { } sub cmdoutput_errok { - die Dumper(\@_)." ?" if grep { !defined } @_; + confess Dumper(\@_)." ?" if grep { !defined } @_; debugcmd "|",@_; open P, "-|", @_ or die "$_[0] $!"; my $d;