source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: correctly handle letters in .Nx arguments; improves for example
@ 2017-07-20 12:54 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-07-20 12:54 UTC (permalink / raw)
  To: source

Log Message:
-----------
correctly handle letters in .Nx arguments; improves for example
getpgid(2), ac(8), ldconfig(8), mount_ffs(8), sa(8), ttyflags(8), ...

Modified Files:
--------------
    mandoc:
        TODO
        mdoc_validate.c

Revision Data
-------------
Index: TODO
===================================================================
RCS file: /home/cvs/mandoc/mandoc/TODO,v
retrieving revision 1.241
retrieving revision 1.242
diff -LTODO -LTODO -u -p -r1.241 -r1.242
--- TODO
+++ TODO
@@ -436,11 +436,6 @@ are mere guesses, and some may be wrong.
   Probably, this should be fixed somewhere in termp_it_pre(), not sure.
   loc *  exist **  algo **  size *  imp **
 
-- .Nx 1.0a
-  should be "NetBSD 1.0A", not "NetBSD 1.0a",
-  see OpenBSD ccdconfig(8).
-  loc *  exist *  algo *  size *  imp **
-
 - In .Bl -tag, if a tag exceeds the right margin and must be continued
   on the next line, it must be indented by -width, not width+1;
   see "rule block|pass" in OpenBSD ifconfig(8).
Index: mdoc_validate.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mdoc_validate.c,v
retrieving revision 1.349
retrieving revision 1.350
diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.349 -r1.350
--- mdoc_validate.c
+++ mdoc_validate.c
@@ -1423,6 +1423,7 @@ post_xx(POST_ARGS)
 {
 	struct roff_node	*n;
 	const char		*os;
+	char			*v;
 
 	post_delim_nb(mdoc);
 
@@ -1439,6 +1440,20 @@ post_xx(POST_ARGS)
 		break;
 	case MDOC_Nx:
 		os = "NetBSD";
+		if (n->child == NULL)
+			break;
+		v = n->child->string;
+		if ((v[0] != '0' && v[0] != '1') || v[1] != '.' ||
+		    v[2] < '0' || v[2] > '9' ||
+		    v[3] < 'a' || v[3] > 'z' || v[4] != '\0')
+			break;
+		n->child->flags |= NODE_NOPRT;
+		mdoc->next = ROFF_NEXT_CHILD;
+		roff_word_alloc(mdoc, n->child->line, n->child->pos, v);
+		v = mdoc->last->string;
+		v[3] = toupper((unsigned char)v[3]);
+		mdoc->last->flags |= NODE_NOSRC;
+		mdoc->last = n;
 		break;
 	case MDOC_Ox:
 		os = "OpenBSD";
--
 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:[~2017-07-20 12:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-20 12:54 mandoc: correctly handle letters in .Nx arguments; improves for example 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).