summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2023-09-04 13:08:12 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2023-09-04 13:08:12 +0000
commit715275ee0209e66fb1426e73e21bb87382aa081f (patch)
tree3f3923901f1419b973dd0aa432ca48124d9d3725 /usr.bin/mandoc/main.c
parent17b8c28fcda25c3350276fd80afeca607efff893 (diff)
Fix a bug where the wrong digit was used for prioritizing filenames
in the standard man(1) mode that formats a single resulting page if the respective manpath contained digits, like X11R6 does. Fortunately, this bug did not trigger for any Xenocara manual page.
Diffstat (limited to 'usr.bin/mandoc/main.c')
-rw-r--r--usr.bin/mandoc/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c
index 280f36539aa..fe8e5a2b1b1 100644
--- a/usr.bin/mandoc/main.c
+++ b/usr.bin/mandoc/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.262 2021/10/04 21:28:50 schwarze Exp $ */
+/* $OpenBSD: main.c,v 1.263 2023/09/04 13:08:11 schwarze Exp $ */
/*
* Copyright (c) 2010-2012, 2014-2021 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -504,7 +504,8 @@ main(int argc, char *argv[])
best_prio = 40;
for (ib = i = 0; i < resnsz; i++) {
- sec = resn[i].file;
+ sec = resn[i].file +
+ strlen(conf.manpath.paths[resn[i].ipath]);
sec += strcspn(sec, "123456789");
if (sec[0] == '\0')
continue; /* No section at all. */