aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/regress/regress.pl
diff options
context:
space:
mode:
Diffstat (limited to 'regress/regress.pl')
-rwxr-xr-xregress/regress.pl22
1 files changed, 12 insertions, 10 deletions
diff --git a/regress/regress.pl b/regress/regress.pl
index 8d7245cb..9d8fcf58 100755
--- a/regress/regress.pl
+++ b/regress/regress.pl
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
#
-# $Id: regress.pl,v 1.8 2017/07/18 18:47:06 schwarze Exp $
+# $Id: regress.pl,v 1.9 2018/12/16 00:17:04 schwarze Exp $
#
# Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
#
@@ -79,23 +79,25 @@ sub syshtml ($@) {
open my $outfd, '>', $outfile or die "$outfile: $!";
my $infd;
my $pid = open3 undef, $infd, undef, @_;
- my $state;
+ my $state = 0;
while (<$infd>) {
chomp;
if (!$state && s/.*<math class="eqn">//) {
- $state = 1;
+ $state = 'math';
next unless length;
+ } elsif (/^BEGINTEST/) {
+ $state = 'other';
}
- $state = 1 if /^BEGINTEST/;
- if ($state && s/<\/math>.*//) {
+ if ($state eq 'math') {
s/^ *//;
- print $outfd "$_\n" if length;
- undef $state;
- next;
+ if (s/<\/math>.*//) {
+ print $outfd "$_\n" if length;
+ $state = 0;
+ next;
+ }
}
- s/^ *//;
print $outfd "$_\n" if $state;
- undef $state if /^ENDTEST/;
+ $state = 0 if /^ENDTEST/;
}
close $outfd;
close $infd;