aboutsummaryrefslogtreecommitdiff
path: root/gnu/usr.bin/man/makewhatis/makewhatis.perl
diff options
context:
space:
mode:
authorWolfram Schneider <wosch@FreeBSD.org>1996-05-14 23:07:05 +0000
committerWolfram Schneider <wosch@FreeBSD.org>1996-05-14 23:07:05 +0000
commit60fa1b83907b83cea5b65edfcb47e4e48ed73874 (patch)
treeff34e84c780a176d21306c990b15c7907fd74876 /gnu/usr.bin/man/makewhatis/makewhatis.perl
parente29f7c9bfd7534f64919c286c3447bb7016f8131 (diff)
downloadsrc-60fa1b83907b83cea5b65edfcb47e4e48ed73874.tar.gz
src-60fa1b83907b83cea5b65edfcb47e4e48ed73874.zip
Makewhatis appended the filename to list of keywords if no keyword
matched the filename. Now put the list after the filename. E.g. filename: vt220keys.1 Keyword: vt220 was: vt220(1), vt220keys(1) - define SHIFTED [...] now: vt220keys(1), vt220(1) - define SHIFTED [...]
Notes
Notes: svn path=/head/; revision=15776
Diffstat (limited to 'gnu/usr.bin/man/makewhatis/makewhatis.perl')
-rw-r--r--gnu/usr.bin/man/makewhatis/makewhatis.perl12
1 files changed, 6 insertions, 6 deletions
diff --git a/gnu/usr.bin/man/makewhatis/makewhatis.perl b/gnu/usr.bin/man/makewhatis/makewhatis.perl
index ca3581683c07..0d21fd609a99 100644
--- a/gnu/usr.bin/man/makewhatis/makewhatis.perl
+++ b/gnu/usr.bin/man/makewhatis/makewhatis.perl
@@ -35,7 +35,7 @@
#
# E-Mail: Wolfram Schneider <wosch@cs.tu-berlin.de>
#
-# $Id: makewhatis.perl,v 1.7 1995/09/10 13:05:52 joerg Exp $
+# $Id: makewhatis.perl,v 1.8 1996/05/12 21:02:04 wosch Exp $
#
sub usage {
@@ -267,7 +267,7 @@ sub out {
}
# The filename of manual page is not a keyword.
-# This may be dangerous, because you don't find the manpage
+# This is bad, because you don't find the manpage
# whith: $ man <section> <keyword>
#
# Add filename if a) filename is not a keyword and b) no keyword(s)
@@ -280,17 +280,17 @@ sub manpagename {
return if $name eq $_;
}
- local($f) = $file;
- $f =~ s%/*[^/]+$%%;
+ local($f) = $file; $f =~ s%/*[^/]+$%%; # dirname
+ local($e) = $file; $e =~ s/$ext$//; $e =~ s%.*(\.[^.]+)$%$1%; # .1
foreach (split(/,\s+/, $man)) {
s/\(.+//;
# a keyword exist as file
- return if -e "$f/$_";
+ return if -e "$f/$_$e" || -e "$f/$_$e$ext";
}
- $man .= ", $name($extension)";
+ $man = "$name($extension), $man";
}
# looking for NAME