chiark / gitweb /
Dgit.pm: printdebug: Strip empty strings from @_ and maybe quit early
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 09:51:14 +0000 (10:51 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Aug 2018 10:38:39 +0000 (11:38 +0100)
Now the meat of the function always has nonempty $_[-1].

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

index c8a6fafec0b41259d37e2069ffabbde86f9f995a..3d517e1e56b8d350648f2a8c55252d15a4014708 100644 (file)
@@ -161,6 +161,8 @@ sub enabledebuglevel ($) {
 sub printdebug {
     return unless $debuglevel >= $printdebug_when_debuglevel;
     print DEBUG $debugprefix;
+    pop @_ while @_ and !length $_[-1];
+    return unless @_;
     print DEBUG @_ or die $!;
 }