aboutsummaryrefslogtreecommitdiffstatshomepage
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 59a35771..1fa652b9 100644
--- a/mansearch.c
+++ b/mansearch.c
@@ -1,4 +1,4 @@
-/* $Id: mansearch.c,v 1.82 2019/07/01 22:56:24 schwarze Exp $ */
+/* $Id: mansearch.c,v 1.83 2022/01/13 04:06:16 schwarze Exp $ */
/*
* 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);