diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-08-23 22:26:06 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-08-23 22:26:06 +0000 |
commit | 6c1d6140e33135edce7e049407226feb8a9763f3 (patch) | |
tree | d22ca425adb6637ec25900ad3016971ec447d375 | |
parent | fa76ca5fca946728b2deacb554748bd672d7f49d (diff) | |
download | mandoc-6c1d6140e33135edce7e049407226feb8a9763f3.tar.gz mandoc-6c1d6140e33135edce7e049407226feb8a9763f3.tar.zst mandoc-6c1d6140e33135edce7e049407226feb8a9763f3.zip |
without search results, skip the processing loops and the parser
-rw-r--r-- | main.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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 <kristaps@bsd.lv> * Copyright (c) 2010, 2011, 2012, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -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 |