aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2019-03-04 13:01:57 +0000
committerIngo Schwarze <schwarze@openbsd.org>2019-03-04 13:01:57 +0000
commitca708704fad0de6eaa3d24f35deead2fb4b5ebf7 (patch)
treecb2e255a750c123b475700630915a5a36e2c02f3 /main.c
parent04c83a367828561c8e5f8f4beb200e2978b5753c (diff)
downloadmandoc-ca708704fad0de6eaa3d24f35deead2fb4b5ebf7.tar.gz
mandoc-ca708704fad0de6eaa3d24f35deead2fb4b5ebf7.tar.zst
mandoc-ca708704fad0de6eaa3d24f35deead2fb4b5ebf7.zip
When the -S option is given to man(1) and the requested manual page
name is not found and the requested architecture is unknown, complain about the architecture rather than about the manual page name: $ man -S vax cpu man: Unknown architecture "vax". $ man -S sparc64 foobar man: No entry for foobar in the manual. Friendlier error message suggested by jmc@, who also OK'ed the patch.
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.c b/main.c
index 74912cf5..257d82cc 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.319 2019/03/03 13:02:11 schwarze Exp $ */
+/* $Id: main.c,v 1.320 2019/03/04 13:01:57 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2019 Ingo Schwarze <schwarze@openbsd.org>
@@ -797,7 +797,11 @@ fs_search(const struct mansearch *cfg, const struct manpaths *paths,
}
if (res != NULL && *ressz == lastsz &&
strchr(*argv, '/') == NULL) {
- if (cfg->sec == NULL)
+ if (cfg->arch != NULL &&
+ arch_valid(cfg->arch, OSENUM) == 0)
+ warnx("Unknown architecture \"%s\".",
+ cfg->arch);
+ else if (cfg->sec == NULL)
warnx("No entry for %s in the manual.",
*argv);
else