From ae42026f2d4af921af9e7b4a6d440182f31a6b79 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 18 Dec 2014 20:15:56 +0000 Subject: 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. --- mdoc_validate.c | 7 +++++-- 1 file 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 * Copyright (c) 2010-2014 Ingo Schwarze @@ -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; } -- cgit v1.2.3-56-ge451