aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-08-23 22:26:06 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-08-23 22:26:06 +0000
commit6c1d6140e33135edce7e049407226feb8a9763f3 (patch)
treed22ca425adb6637ec25900ad3016971ec447d375 /main.c
parentfa76ca5fca946728b2deacb554748bd672d7f49d (diff)
downloadmandoc-6c1d6140e33135edce7e049407226feb8a9763f3.tar.gz
mandoc-6c1d6140e33135edce7e049407226feb8a9763f3.tar.zst
mandoc-6c1d6140e33135edce7e049407226feb8a9763f3.zip
without search results, skip the processing loops and the parser
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 9 insertions, 1 deletions
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 <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