aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit7196a1d3dfecffb71c9eafd071a2a7bfcfb9b23c (patch)
treeb28a8915fcae3b77661b2a76616e753894165281 /main.c
parent65cb55128b6d29e9afc9785b71a33da74ca56ed0 (diff)
downloadmandoc-7196a1d3dfecffb71c9eafd071a2a7bfcfb9b23c.tar.gz
mandoc-7196a1d3dfecffb71c9eafd071a2a7bfcfb9b23c.tar.zst
mandoc-7196a1d3dfecffb71c9eafd071a2a7bfcfb9b23c.zip
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.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/main.c b/main.c
index 600bc9bb..9061014a 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.306 2018/05/14 14:10:23 schwarze Exp $ */
+/* $Id: main.c,v 1.307 2018/08/09 17:30:36 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -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--;