From 6939ed3cf1934623e887fc392bf4bb8126dfac6f Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 20 Apr 2015 09:54:48 +0000 Subject: Fix previous: Don't let man(1) warn twice about non-existant names. Again noticed by deraadt@. --- main.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 261bf4b7..36bd3d97 100644 --- a/main.c +++ b/main.c @@ -352,13 +352,17 @@ main(int argc, char *argv[]) sz = 0; #endif - 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; } -- cgit