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 | 7196a1d3dfecffb71c9eafd071a2a7bfcfb9b23c (patch) | |
tree | b28a8915fcae3b77661b2a76616e753894165281 | |
parent | 65cb55128b6d29e9afc9785b71a33da74ca56ed0 (diff) | |
download | mandoc-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@.
-rw-r--r-- | main.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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--; |