From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (schwarze@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id s3F0fAdI002517 for ; Mon, 14 Apr 2014 20:41:10 -0400 (EDT) Received: (from schwarze@localhost) by krisdoz.my.domain (8.14.5/8.14.3/Submit) id s3F0fAJ7026138; Mon, 14 Apr 2014 20:41:10 -0400 (EDT) Date: Mon, 14 Apr 2014 20:41:10 -0400 (EDT) Message-Id: <201404150041.s3F0fAJ7026138@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Using macros in .Sh header lines, or having .Sm off or .Bk X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Using macros in .Sh header lines, or having .Sm off or .Bk -words open while processing .Sh, is not at all recommended, but it's not strictly a syntax violation either, and in any case, mandoc must not die in an assertion. I broke this in rev. 1.124. Crash found while trying to read the (rather broken) original 4.3BSD-Reno od(1) manual page. Modified Files: -------------- mdocml: mdoc_validate.c Revision Data ------------- Index: mdoc_validate.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_validate.c,v retrieving revision 1.208 retrieving revision 1.209 diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.208 -r1.209 --- mdoc_validate.c +++ mdoc_validate.c @@ -1950,7 +1950,7 @@ static int post_sh_head(POST_ARGS) { struct mdoc_node *n; - const char *secname; + char *secname; enum mdoc_sec sec; /* @@ -1962,15 +1962,8 @@ post_sh_head(POST_ARGS) secname = NULL; sec = SEC_CUSTOM; - n = mdoc->last; - if (n->child) { - assert(1 == n->nchild); - n = n->child; - assert(NULL != n); - assert(MDOC_TEXT == n->type); - secname = n->string; - sec = a2sec(secname); - } + mdoc_deroff(&secname, mdoc->last); + sec = NULL == secname ? SEC_CUSTOM : a2sec(secname); /* The NAME should be first. */ @@ -2007,8 +2000,10 @@ post_sh_head(POST_ARGS) /* We don't care about custom sections after this. */ - if (SEC_CUSTOM == sec) + if (SEC_CUSTOM == sec) { + free(secname); return(1); + } /* * Check whether our non-custom section is being repeated or is @@ -2052,6 +2047,7 @@ post_sh_head(POST_ARGS) break; } + free(secname); return(1); } -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv