diff options
Diffstat (limited to 'mansrv')
-rwxr-xr-x | mansrv | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -40,2 +40,10 @@ my $mansep; +my %decomp = ( + 'gz' => 'gzip -d -c', + 'bz2' => 'bzip2 -d -c', + 'z' => 'compress -d -c', + 'Z' => 'compress -d -c' +); + + sub syserror { @@ -247,5 +255,5 @@ unless (-e $cachefile && checkdeps($cachefile)) { } - - if ($file =~ /\.gz$/) { - $groffcmd = "gzip -d -c $file | $groffcmd -"; + + if ($file =~ /.*\.([^.]+)$/ && exists($decomp{$1})) { + $groffcmd = "$decomp{$1} $file | $groffcmd -"; } else { |