source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: In man(1) mode, when the first argument starts with a digit,
@ 2019-05-03  9:39 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-05-03  9:39 UTC (permalink / raw)
  To: source

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 <loreb at github>
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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-03  9:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-03  9:39 mandoc: In man(1) mode, when the first argument starts with a digit, schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).