From 7196a1d3dfecffb71c9eafd071a2a7bfcfb9b23c Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 9 Aug 2018 17:30:36 +0000 Subject: 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@. --- main.c | 12 +++++++++--- 1 file 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 * Copyright (c) 2010-2012, 2014-2018 Ingo Schwarze @@ -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--; -- cgit v1.2.3