diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2001-03-14 10:56:25 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2001-03-14 10:56:25 +0000 |
commit | 30b16021f82bbf8e0754eefd517030e541ace317 (patch) | |
tree | 6389772e6a78dba3849f8383036ffbe3af0ca94c | |
parent | 28e9fc9a941b08892f7de8b73a224636002100fe (diff) |
Allow makewhatis -p -t filename, without full path.
-rw-r--r-- | libexec/makewhatis/makewhatis.pl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libexec/makewhatis/makewhatis.pl b/libexec/makewhatis/makewhatis.pl index 0745b448cf3..00bf38b7cae 100644 --- a/libexec/makewhatis/makewhatis.pl +++ b/libexec/makewhatis/makewhatis.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # ex:ts=8 sw=4: -# $OpenBSD: makewhatis.pl,v 1.15 2001/02/25 09:04:25 espie Exp $ +# $OpenBSD: makewhatis.pl,v 1.16 2001/03/14 10:56:24 espie Exp $ # # Copyright (c) 2000 Marc Espie. # @@ -96,7 +96,11 @@ sub verify_subject my $section = $2; my @mans = split(/\s*,\s*|\s+/, $man); my $base = $filename; - $base =~ s,/[^/]*$,,; + if ($base =~ m|/|) { + $base =~ s,/[^/]*$,,; + } else { + $base = '.'; + } for my $i (@mans) { next if found("$base/$i.*"); # try harder |