From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id ccda4e0b for ; Fri, 3 May 2019 04:39:55 -0500 (EST) Date: Fri, 3 May 2019 04:39:55 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: In man(1) mode, when the first argument starts with a digit, X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: Log Message: ----------- 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 as part of https://github.com/void-linux/void-packages/issues/9868 . Modified Files: -------------- mandoc: main.c Revision Data ------------- Index: main.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/main.c,v retrieving revision 1.323 retrieving revision 1.324 diff -Lmain.c -Lmain.c -u -p -r1.323 -r1.324 --- main.c +++ main.c @@ -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++; -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv