summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2015-04-20 09:54:35 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2015-04-20 09:54:35 +0000
commit89cf0045aa2f047e54feb427740a71264d9dc1b6 (patch)
treea4480f0c50adbf302276b98065a7a4351dfd8345 /usr.bin/mandoc
parent4e9c0f5a2d754b29d7ac1afe55c9750156bcc7e5 (diff)
Fix previous: Don't let man(1) warn twice about non-existant names.
Again noticed by deraadt@.
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r--usr.bin/mandoc/main.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c
index 80d0feeba45..859e844847c 100644
--- a/usr.bin/mandoc/main.c
+++ b/usr.bin/mandoc/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.141 2015/04/19 15:10:04 schwarze Exp $ */
+/* $OpenBSD: main.c,v 1.142 2015/04/20 09:54:34 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -331,13 +331,17 @@ main(int argc, char *argv[])
argc, argv, &res, &sz))
usage(search.argmode);
- if (sz == 0 && search.argmode == ARG_NAME)
- fs_search(&search, &conf.manpath,
- argc, argv, &res, &sz);
+ if (sz == 0) {
+ if (search.argmode == ARG_NAME)
+ fs_search(&search, &conf.manpath,
+ argc, argv, &res, &sz);
+ else
+ fprintf(stderr,
+ "%s: nothing appropriate\n",
+ progname);
+ }
if (sz == 0) {
- fprintf(stderr, "%s: nothing appropriate\n",
- progname);
rc = MANDOCLEVEL_BADARG;
goto out;
}