aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mansearch.c
diff options
context:
space:
mode:
Diffstat (limited to 'mansearch.c')
-rw-r--r--mansearch.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/mansearch.c b/mansearch.c
index 9c88fac8..938d48c4 100644
--- a/mansearch.c
+++ b/mansearch.c
@@ -1,4 +1,4 @@
-/* $Id: mansearch.c,v 1.48 2014/09/03 18:09:14 schwarze Exp $ */
+/* $Id: mansearch.c,v 1.49 2014/11/11 19:04:55 schwarze Exp $ */
/*
* Copyright (c) 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -352,6 +352,14 @@ mansearch(const struct mansearch *search,
sqlite3_finalize(s2);
sqlite3_close(db);
ohash_delete(&htab);
+
+ /*
+ * In man(1) mode, prefer matches in earlier trees
+ * over matches in later trees.
+ */
+
+ if (cur && search->firstmatch)
+ break;
}
qsort(*res, cur, sizeof(struct manpage), manpage_compare);
rc = 1;