util/dofile.pl: report if a template couldn't be loaded

Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
Richard Levitte 2016-09-21 01:49:04 +02:00
parent 5a008ff6c5
commit f6be8315cb

View file

@ -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} = $_;