From c02a7420f1ec019a74b86d63369c4755aa293a2d Mon Sep 17 00:00:00 2001 From: schwarze Date: Mon, 4 Sep 2023 13:08:11 +0000 Subject: [PATCH] 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. --- usr.bin/mandoc/main.c | 5 +++-- 1 file 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 * Copyright (c) 2008-2012 Kristaps Dzonsons @@ -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. */ -- 2.20.1