summaryrefslogtreecommitdiffstats
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
commit6fa89d30426089ab004ea00e810f29e4760da0f1 (patch)
treef18fc417278563c61c4f8b0fa568525b3a54be79
parent0c2d768cbe4570b38ac18d2408449604fab0186b (diff)
downloadmandoc-6fa89d30426089ab004ea00e810f29e4760da0f1.tar.gz
without search results, skip the processing loops and the parser
-rw-r--r--main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.c b/main.c
index 33d1f07b..5b473292 100644
--- a/main.c
+++ b/main.c
@@ -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