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 0af8f035 for ; Thu, 20 Jul 2017 07:54:33 -0500 (EST) Date: Thu, 20 Jul 2017 07:54:33 -0500 (EST) Message-Id: <1669432982273430921.enqueue@fantadrom.bsd.lv> 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: correctly handle letters in .Nx arguments; improves for example X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 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