Better section guessing for manual pages without suffix. The

plan9 manual pages dont have a suffix.
This commit is contained in:
Wolfram Schneider 1997-07-04 22:32:59 +00:00
parent c3d7c52e04
commit 09eac7d4b2

View file

@ -26,7 +26,7 @@
#
# makewhatis -- update the whatis database in the man directories.
#
# $Id: makewhatis.perl,v 1.11 1996/08/27 20:04:09 wosch Exp $
# $Id: makewhatis.perl,v 1.16 1997/03/14 21:58:43 wosch Exp $
sub usage {
@ -172,7 +172,7 @@ sub parse_dir {
delete $man_red{$file};
}
if ($dir =~ /man$/) {
if ($dir =~ /man/) {
warn "\n" if $verbose && $pointflag;
warn "open manpath directory ``$dir''\n" if $verbose;
$pointflag = 0;
@ -218,10 +218,10 @@ sub ext {
$extension =~ s/$ext$//g; # strip .gz
$extension =~ s/.*\///g; # basename
if ($extension !~ /\./) { # no dot
if ($extension !~ m%[^/]+\.[^.]+$%) { # no dot
$extension = $filename;
#$extension =~ s|/[^/]+$||;
$extension =~ s/.*(.)/$1/; # last character
$extension =~ s%.*man([^/]+)/[^/]+%$1%; # last character
warn "\n" if $verbose && $pointflag;
warn "$filename has no extension, try section ``$extension''\n"
if $verbose;