Handle (rpm) section man pages
authorJamie Cameron <jcameron@webmin.com>
Wed, 4 Jun 2008 17:33:16 +0000 (17:33 +0000)
committerJamie Cameron <jcameron@webmin.com>
Wed, 4 Jun 2008 17:33:16 +0000 (17:33 +0000)
man/view_man.cgi

index f442087..60ce730 100755 (executable)
@@ -47,12 +47,14 @@ if (!$found) {
        }
 else {
        if (&has_command($config{'man2html_path'})) {
+               # Last line only
+               @lines = split(/\r?\n/, $out);
+               $out = $lines[$#lines];
                 if ($out =~ /\(<--\s+(.*)\)/) {
                         # Output has cached file and original path
                         $out = $1;
                         }
                $out =~ s/ .*//;
-               $out =~ s/\n//;
                if( $out =~ /^.*\.gz/i ) {
                        $cmd = "gunzip -c";
                        }