aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-11-11 19:04:55 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-11-11 19:04:55 +0000
commitedcebb2ccc1d9dff61cbd2cf688598e28aa576b0 (patch)
treeb481bdcdc0a131e23df132227f253f7e7b235828 /main.c
parent90abf6007b8853890d1204e9249848383de26416 (diff)
downloadmandoc-edcebb2ccc1d9dff61cbd2cf688598e28aa576b0.tar.gz
mandoc-edcebb2ccc1d9dff61cbd2cf688598e28aa576b0.tar.zst
mandoc-edcebb2ccc1d9dff61cbd2cf688598e28aa576b0.zip
In man(1) mode without -a, stop searching after the first manual tree
that contained at least one match in order to not prefer mdoc(1) from ports over mdoc(7). As a bonus, this results in a speedup.
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.c b/main.c
index af31a474..63ac45e8 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.198 2014/11/11 02:43:41 schwarze Exp $ */
+/* $Id: main.c,v 1.199 2014/11/11 19:04:55 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011, 2012, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -294,6 +294,10 @@ main(int argc, char *argv[])
if (argc == 0)
usage(search.argmode);
+ if (search.argmode == ARG_NAME &&
+ outmode == OUTMODE_ONE)
+ search.firstmatch = 1;
+
/* Access the mandoc database. */
manpath_parse(&paths, conf_file, defpaths, auxpaths);