diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-12-18 20:15:56 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-12-18 20:15:56 +0000 |
commit | ae42026f2d4af921af9e7b4a6d440182f31a6b79 (patch) | |
tree | 5218bc586dbb8cd2470fc8fb5069b1966964ea17 /mdoc_validate.c | |
parent | 229720cce01cf21062785d79f3458f2971523654 (diff) | |
download | mandoc-ae42026f2d4af921af9e7b4a6d440182f31a6b79.tar.gz mandoc-ae42026f2d4af921af9e7b4a6d440182f31a6b79.tar.zst mandoc-ae42026f2d4af921af9e7b4a6d440182f31a6b79.zip |
Only keep leading .Sm inside a list when it immediately precedes
the first .It. Otherwise, move it out together with whatever
follows. Fixing an assertion failure found by jsg@ with afl.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r-- | mdoc_validate.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index 01b2f1b7..0f5cf5c5 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.264 2014/12/18 19:23:41 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.265 2014/12/18 20:15:56 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -1484,7 +1484,10 @@ post_bl(POST_ARGS) nchild = nbody->child; while (NULL != nchild) { - if (MDOC_It == nchild->tok || MDOC_Sm == nchild->tok) { + if (nchild->tok == MDOC_It || + (nchild->tok == MDOC_Sm && + nchild->next != NULL && + nchild->next->tok == MDOC_It)) { nchild = nchild->next; continue; } |