summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2018-08-09 17:23:22 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2018-08-09 17:23:22 +0000
commit560651bab8f17c0b1c159eefa6d26e89e6111d16 (patch)
treea5b75f8a0203ed40f7ec14a45f067af131d775d1 /usr.bin/mandoc
parentc42adafe64a68232b312a3f205ea2e0a6585b064 (diff)
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 'usr.bin/mandoc')
-rw-r--r--usr.bin/mandoc/main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c
index 168feb61d21..d9b67f5849e 100644
--- a/usr.bin/mandoc/main.c
+++ b/usr.bin/mandoc/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.209 2018/05/14 14:09:48 schwarze Exp $ */
+/* $OpenBSD: main.c,v 1.210 2018/08/09 17:23:21 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -760,8 +760,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--;