summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mansearch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mansearch.c b/mansearch.c
index b9d62267..3e9f3326 100644
--- a/mansearch.c
+++ b/mansearch.c
@@ -1,4 +1,4 @@
-/* $Id$ */
+/* $Id$ */
/*
* Copyright (c) 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013-2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -220,7 +220,7 @@ mansearch(const struct mansearch *search,
if (cur && search->firstmatch)
break;
}
- if (res != NULL)
+ if (res != NULL && cur > 1)
qsort(*res, cur, sizeof(struct manpage), manpage_compare);
if (chdir_status && getcwd_status && chdir(buf) == -1)
warn("%s", buf);