summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-08-09 17:30:36 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-08-09 17:30:36 +0000
commit220517fb68d12713ff95882a6d53ead200d12fcf (patch)
treef27728e98a463a8be4b5aca0b4c7467c5418ed42 /main.c
parent56712f0794e70d6c79aaa29b06519a8458b3a0fe (diff)
downloadmandoc-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@.
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/main.c b/main.c
index 4dc73df1..3f36234d 100644
--- a/main.c
+++ b/main.c
@@ -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--;