diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2018-08-09 17:30:36 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2018-08-09 17:30:36 +0000 |
commit | 220517fb68d12713ff95882a6d53ead200d12fcf (patch) | |
tree | f27728e98a463a8be4b5aca0b4c7467c5418ed42 | |
parent | 56712f0794e70d6c79aaa29b06519a8458b3a0fe (diff) | |
download | mandoc-220517fb68d12713ff95882a6d53ead200d12fcf.tar.gz |
If somebody asks "man 3 chmod",
don't respond with the lie: "No entry for chmod in the manual."
Instead, say "No entry for chmod in section 3 of the manual."
Came up after a question from kn@; OK kn@.
-rw-r--r-- | main.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -790,8 +790,14 @@ fs_search(const struct mansearch *cfg, const struct manpaths *paths, return 1; } if (res != NULL && *ressz == lastsz && - strchr(*argv, '/') == NULL) - warnx("No entry for %s in the manual.", *argv); + strchr(*argv, '/') == NULL) { + if (cfg->sec == NULL) + warnx("No entry for %s in the manual.", + *argv); + else + warnx("No entry for %s in section %s " + "of the manual.", *argv, cfg->sec); + } lastsz = *ressz; argv++; argc--; |