examples: fix the leading empty line

* examples/extexi: Really avoid the first empty line.
Remove useless `next`.
This commit is contained in:
Akim Demaille
2018-08-23 18:49:46 +02:00
parent 3fda8335bf
commit e504c843c1

View File

@@ -116,17 +116,16 @@ sub process ($)
{ {
if (/^\@(small)?example$/) if (/^\@(small)?example$/)
{ {
$input .= "\n" unless defined $input;
# Bison supports synclines, but not Flex. # Bison supports synclines, but not Flex.
$input .= sprintf ("#line %s \"$in\"\n", $. + 1) $input .= sprintf ("#line %s \"$in\"\n", $. + 1)
if $synclines && $file =~ /\.[chy]*$/; if $synclines && $file =~ /\.[chy]*$/;
next;
} }
elsif (/^\@end (small)?example$/) elsif (/^\@end (small)?example$/)
{ {
die "no contents: $file" die "no contents: $file"
if $input eq ""; if $input eq "";
$file{$file}{$block} .= "\n" if defined $file{$file}{$block};
$file{$file}{$block} .= normalize($input); $file{$file}{$block} .= normalize($input);
$file = $input = undef; $file = $input = undef;
++$block; ++$block;