aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2019-04-30 18:51:57 +0000
committerIngo Schwarze <schwarze@openbsd.org>2019-04-30 18:51:57 +0000
commitd01c0c49e94a1aa06cfb7222d031a4d3e1f2e18a (patch)
tree528a8c13443fe687d14cca18e98f0010b56fdf1b /main.c
parentc97489f192655f4c659019bb01065f81365849a8 (diff)
downloadmandoc-d01c0c49e94a1aa06cfb7222d031a4d3e1f2e18a.tar.gz
mandoc-d01c0c49e94a1aa06cfb7222d031a4d3e1f2e18a.tar.zst
mandoc-d01c0c49e94a1aa06cfb7222d031a4d3e1f2e18a.zip
In man(1) mode, i.e. when asking for a single manual page by name,
prefer file name matches over .Dt/.TH matches over first NAME matches over later NAME matches, but do not change the ordering for apropos(1) nor for man -a. This reverts main.c rev. 1.310 and mansearch.h rev. 1.29 and includes a partial revert of mansearch.c rev. 1.79. Regression reported by Lorenzo Beretta <loreb at github> as part of https://github.com/void-linux/void-packages/issues/9868 .
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.c b/main.c
index b91c1586..bbc82bf9 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.322 2019/03/06 10:18:58 schwarze Exp $ */
+/* $Id: main.c,v 1.323 2019/04/30 18:51:57 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014-2019 Ingo Schwarze <schwarze@openbsd.org>
@@ -411,6 +411,7 @@ main(int argc, char *argv[])
res[sz].file = mandoc_strdup(argv[c]);
res[sz].names = NULL;
res[sz].output = NULL;
+ res[sz].bits = 0;
res[sz].ipath = SIZE_MAX;
res[sz].sec = 10;
res[sz].form = FORM_SRC;
@@ -761,6 +762,7 @@ found:
page->file = file;
page->names = NULL;
page->output = NULL;
+ page->bits = NAME_FILE & NAME_MASK;
page->ipath = ipath;
page->sec = (*sec >= '1' && *sec <= '9') ? *sec - '1' + 1 : 10;
page->form = form;