summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-08-06 16:19:43 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-08-06 16:19:43 +0000
commit03b835a83b4f258c93638a1d4febe312d4044af6 (patch)
treefa858d19beeea363f6ad63b2e0d79dd38bd8b197 /libexec
parentf57afde4097261daa8fd91db9fc96c8e252dd724 (diff)
not an error when merging in a directory without whatis.db.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/makewhatis/OpenBSD/Makewhatis.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/libexec/makewhatis/OpenBSD/Makewhatis.pm b/libexec/makewhatis/OpenBSD/Makewhatis.pm
index b0743ae0157..74806b1f084 100644
--- a/libexec/makewhatis/OpenBSD/Makewhatis.pm
+++ b/libexec/makewhatis/OpenBSD/Makewhatis.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Makewhatis.pm,v 1.2 2004/08/06 14:09:35 espie Exp $
+# $OpenBSD: Makewhatis.pm,v 1.3 2004/08/06 16:19:42 espie Exp $
# Copyright (c) 2000-2004 Marc Espie <espie@openbsd.org>
#
# Permission to use, copy, modify, and distribute this software for any
@@ -105,14 +105,14 @@ sub merge
die "$0: $mandir: not a directory"
}
my $whatis = "$mandir/whatis.db";
- open(my $old, '<', $whatis) or
- die "$0 $whatis to merge with";
my $subjects = scan_manpages($args);
- while (<$old>) {
- chomp;
- push(@$subjects, $_);
+ if (open(my $old, '<', $whatis)) {
+ while (<$old>) {
+ chomp;
+ push(@$subjects, $_);
+ }
+ close($old);
}
- close($old);
OpenBSD::Makewhatis::Whatis::write($subjects, $mandir);
}