From 6c1d6140e33135edce7e049407226feb8a9763f3 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 23 Aug 2014 22:26:06 +0000 Subject: without search results, skip the processing loops and the parser --- main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index ece2ebcb..e0380e94 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.186 2014/08/23 00:34:59 schwarze Exp $ */ +/* $Id: main.c,v 1.187 2014/08/23 22:26:06 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010, 2011, 2012, 2014 Ingo Schwarze @@ -283,6 +283,14 @@ main(int argc, char *argv[]) manpath_free(&paths); resp = res; + if (sz == 0) { + if (search.argmode == ARG_NAME) + fprintf(stderr, "%s: No entry for %s " + "in the manual.\n", progname, argv[0]); + rc = MANDOCLEVEL_BADARG; + goto out; + } + /* * For standard man(1) and -a output mode, * prepare for copying filename pointers -- cgit v1.2.3-56-ge451