From 87030f54b23d39d9f4b1122b80adc6b7f8deab53 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 21 Sep 2016 01:49:04 +0200 Subject: [PATCH] util/dofile.pl: report if a template couldn't be loaded Reviewed-by: Rich Salz (cherry picked from commit f6be8315cbdb4173008b5917d2b0fc80bb0bf06b) --- util/dofile.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/dofile.pl b/util/dofile.pl index e0333fe568..8b0c7b41c0 100644 --- a/util/dofile.pl +++ b/util/dofile.pl @@ -159,7 +159,11 @@ my @autowarntext = ("WARNING: do not edit!", my $prev_linecount = 0; my $text = @ARGV - ? join("", map { my $x = "{- output_reset_on() -}".Text::Template::_load_text($_); + ? join("", map { my $x = Text::Template::_load_text($_); + if (!defined($x)) { + die $Text::Template::ERROR, "\n"; + } + $x = "{- output_reset_on() -}" . $x; my $linecount = $x =~ tr/\n//; $prev_linecount = ($linecount += $prev_linecount); $lines{$linecount} = $_; -- 2.25.1