diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-08-09 17:23:22 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-08-09 17:23:22 +0000 |
commit | 560651bab8f17c0b1c159eefa6d26e89e6111d16 (patch) | |
tree | a5b75f8a0203ed40f7ec14a45f067af131d775d1 /usr.bin/mandoc | |
parent | c42adafe64a68232b312a3f205ea2e0a6585b064 (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.c | 12 |
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--; |