diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-04-03 21:45:31 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-04-03 21:45:31 +0000 |
commit | 2ec6816f1cda38fe01c3503f57dd7fd1132045c1 (patch) | |
tree | 1ce8e6e62db74b805a08027046a6c3b8bb2deb51 | |
parent | 2fcbd1967fefe0ad3a462b25726a0cbd7483bfd7 (diff) | |
download | mandoc-2ec6816f1cda38fe01c3503f57dd7fd1132045c1.tar.gz |
Instead of silently doing nothing at all,
warn and return non-zero when the manpath is empty, that is,
when /etc/man.conf is non-existent or unreadable
AND the environment variable MANPATH is unset or empty
AND no directories were given on the command line.
Inspired by the error handling in espie@'s makewhatis(8),
except that one doesn't know about MANPATH.
-rw-r--r-- | mandocdb.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -462,6 +462,11 @@ main(int argc, char *argv[]) } else manpath_parse(&dirs, path_arg, NULL, NULL); + if (0 == dirs.sz) { + exitcode = (int)MANDOCLEVEL_BADARG; + say("", "Empty manpath"); + } + /* * First scan the tree rooted at a base directory, then * build a new database and finally move it into place. |