diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2019-05-03 09:39:25 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2019-05-03 09:39:25 +0000 |
commit | 84e13bf87685da08e180f0fb8e981620974ce575 (patch) | |
tree | 81ae0e131874972c0433af8f95fcf7698767cce0 /main.c | |
parent | d756850b9bce47856068b05130c6277125b6f0a1 (diff) | |
download | mandoc-84e13bf87685da08e180f0fb8e981620974ce575.tar.gz |
In man(1) mode, when the first argument starts with a digit,
optionally followed by a letter, and at least one more argument
follows, interpret the first argument as a section name even when
additional characters follow after the digit and letter.
This is needed because many operating systems have section names
consisting of a digit followed by more than one letter - for example
Illumos, Solaris, Linux, even NetBSD.
There is very little risk of regressions: in the whole corpus of
manual pages on man.openbsd.org, there isn't a single manual page
name starting with a digit. And even if programs like "0ad" or
"4channels" had manual pages, "man 0ad" and "man -a cat 0ad" would
still work, only "man -a 0ad cat" will fail with "man: No entry for
cat in section 0ad of the manual."
Fixing one of the issues 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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -355,7 +355,7 @@ main(int argc, char *argv[]) } else if (argc > 1 && ((uc = (unsigned char *)argv[0]) != NULL) && ((isdigit(uc[0]) && (uc[1] == '\0' || - (isalpha(uc[1]) && uc[2] == '\0'))) || + isalpha(uc[1]))) || (uc[0] == 'n' && uc[1] == '\0'))) { search.sec = (char *)uc; argv++; |