summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-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