aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-07-20 12:54:02 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-07-20 12:54:02 +0000
commitfa9bd450fd23dcd2191412780cbdfb66f8464838 (patch)
tree1128a577b235cf461e53a661b0b1c2d5b401d544
parenta3be7c1a746beba40319f86f71bed1b6a70b102e (diff)
downloadmandoc-fa9bd450fd23dcd2191412780cbdfb66f8464838.tar.gz
mandoc-fa9bd450fd23dcd2191412780cbdfb66f8464838.tar.zst
mandoc-fa9bd450fd23dcd2191412780cbdfb66f8464838.zip
correctly handle letters in .Nx arguments; improves for example
getpgid(2), ac(8), ldconfig(8), mount_ffs(8), sa(8), ttyflags(8), ...
-rw-r--r--TODO7
-rw-r--r--mdoc_validate.c17
2 files changed, 17 insertions, 7 deletions
diff --git a/TODO b/TODO
index 9a960dab..ed71dab0 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,6 @@
************************************************************************
* Official mandoc TODO.
-* $Id: TODO,v 1.241 2017/07/20 11:58:31 schwarze Exp $
+* $Id: TODO,v 1.242 2017/07/20 12:54:02 schwarze Exp $
************************************************************************
Many issues are annotated for difficulty as follows:
@@ -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).
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 1ca92707..de36bb84 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.349 2017/07/15 16:40:29 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.350 2017/07/20 12:54:02 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -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";