chiark / gitweb /
Dgit.pm: fail: Strip any trailing newline
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 18 Sep 2016 22:45:19 +0000 (23:45 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 25 Sep 2016 19:12:52 +0000 (20:12 +0100)
This makes it sensible to call fail() with a here doc.

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

index bfa76cc..7c43059 100644 (file)
@@ -159,6 +159,7 @@ sub _us () {
 
 sub fail { 
     my $s = "@_\n";
+    $s =~ s/\n\n$/\n/;
     my $prefix = _us().": ";
     $s =~ s/^/$prefix/gm;
     die $s;