diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2010-10-25 17:42:30 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2010-10-25 17:42:30 +0000 |
commit | 3607cf6ef392fa38e060f7647ad2261df969610b (patch) | |
tree | bf859d6e38416c5ea6c1fc7f43820c3df57c21c9 /libexec/makewhatis | |
parent | eda3cd98e25d02b19e5d1481ffbb1fb6f52ed8af (diff) |
give a different error message for empty files, as they are obviously wrong
Diffstat (limited to 'libexec/makewhatis')
-rw-r--r-- | libexec/makewhatis/OpenBSD/Makewhatis.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libexec/makewhatis/OpenBSD/Makewhatis.pm b/libexec/makewhatis/OpenBSD/Makewhatis.pm index 0283a254804..157fd1e90d1 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.8 2010/07/13 15:38:27 espie Exp $ +# $OpenBSD: Makewhatis.pm,v 1.9 2010/10/25 17:42:29 espie Exp $ # Copyright (c) 2000-2004 Marc Espie <espie@openbsd.org> # # Permission to use, copy, modify, and distribute this software for any @@ -98,6 +98,10 @@ sub scan_manpages } $_ = $`; } else { + if (-z $_) { + $p->errsay("Empty file #1", $_); + next; + } unless (open $file, '<', $_) { $p->errsay("#1: can't read #2: #3", $0, $_, $!); next; |