From: schwarze Date: Thu, 9 Aug 2018 17:23:21 +0000 (+0000) Subject: If somebody asks "man 3 chmod", X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c13ada2b54ea1c46aff475657d068bd1fbd64ef1;p=openbsd 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@. --- 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 * Copyright (c) 2010-2012, 2014-2018 Ingo Schwarze @@ -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--;