version 1.8, 2017/07/18 18:47:06 |
version 1.10, 2019/03/10 09:23:33 |
Line 27 use IPC::Open3 qw(open3); |
|
Line 27 use IPC::Open3 qw(open3); |
|
# Define this at one place such that it can easily be changed |
# Define this at one place such that it can easily be changed |
# if diff(1) does not support the -a option. |
# if diff(1) does not support the -a option. |
my @diff = qw(diff -au); |
my @diff = qw(diff -au); |
|
system @diff, '/dev/null', '/dev/null' and @diff = qw(diff -u); |
|
|
# --- utility functions ------------------------------------------------ |
# --- utility functions ------------------------------------------------ |
|
|
Line 79 sub syshtml ($@) { |
|
Line 80 sub syshtml ($@) { |
|
open my $outfd, '>', $outfile or die "$outfile: $!"; |
open my $outfd, '>', $outfile or die "$outfile: $!"; |
my $infd; |
my $infd; |
my $pid = open3 undef, $infd, undef, @_; |
my $pid = open3 undef, $infd, undef, @_; |
my $state; |
my $state = 0; |
while (<$infd>) { |
while (<$infd>) { |
chomp; |
chomp; |
if (!$state && s/.*<math class="eqn">//) { |
if (!$state && s/.*<math class="eqn">//) { |
$state = 1; |
$state = 'math'; |
next unless length; |
next unless length; |
|
} elsif (/^BEGINTEST/) { |
|
$state = 'other'; |
} |
} |
$state = 1 if /^BEGINTEST/; |
if ($state eq 'math') { |
if ($state && s/<\/math>.*//) { |
|
s/^ *//; |
s/^ *//; |
print $outfd "$_\n" if length; |
if (s/<\/math>.*//) { |
undef $state; |
print $outfd "$_\n" if length; |
next; |
$state = 0; |
|
next; |
|
} |
} |
} |
s/^ *//; |
|
print $outfd "$_\n" if $state; |
print $outfd "$_\n" if $state; |
undef $state if /^ENDTEST/; |
$state = 0 if /^ENDTEST/; |
} |
} |
close $outfd; |
close $outfd; |
close $infd; |
close $infd; |