summaryrefslogtreecommitdiff
path: root/libexec/makewhatis/makewhatis.pl
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2001-03-14 10:56:25 +0000
committerMarc Espie <espie@cvs.openbsd.org>2001-03-14 10:56:25 +0000
commit30b16021f82bbf8e0754eefd517030e541ace317 (patch)
tree6389772e6a78dba3849f8383036ffbe3af0ca94c /libexec/makewhatis/makewhatis.pl
parent28e9fc9a941b08892f7de8b73a224636002100fe (diff)
Allow makewhatis -p -t filename, without full path.
Diffstat (limited to 'libexec/makewhatis/makewhatis.pl')
-rw-r--r--libexec/makewhatis/makewhatis.pl8
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