From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp1.rz.uni-karlsruhe.de (Debian-exim@smtp1.rz.uni-karlsruhe.de [129.13.185.217]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id oBC07S2O020964 for ; Sat, 11 Dec 2010 19:07:30 -0500 (EST) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by smtp1.rz.uni-karlsruhe.de with esmtp (Exim 4.63 #1) id 1PRZTJ-0006w1-8r; Sun, 12 Dec 2010 01:07:25 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1PRZTJ-0003AM-6E for tech@mdocml.bsd.lv; Sun, 12 Dec 2010 01:07:25 +0100 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.69) (envelope-from ) id 1PRZTJ-0002TX-5W for tech@mdocml.bsd.lv; Sun, 12 Dec 2010 01:07:25 +0100 Received: from schwarze by usta.de with local (Exim 4.72) (envelope-from ) id 1PRZTJ-00013l-4b for tech@mdocml.bsd.lv; Sun, 12 Dec 2010 01:07:25 +0100 Date: Sun, 12 Dec 2010 01:07:25 +0100 From: Ingo Schwarze To: tech@mdocml.bsd.lv Subject: [PATCH] .Bk with invalid arguments Message-ID: <20101212000725.GB19330@iris.usta.de> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Hi, while looking at some regression tests and trying to get them committed, i noticed that .Bk behaves differently when given invalid arguments. 1. .Bk -words works the same with mandoc, old and new groff. 2. .Bk without any arg should default to -words according to new groff. 3. .Bk with invalid args (or -lines) should have no effect according to new groff. The following mini-patch adjusts mandoc to do the same. For now, -words is the only argument accepted by mandoc, so to catch case 1, it's sufficient to check for any arguments at all, and to catch 2, it's suffcient to check that the HEAD has no children. OK? Index: mdoc_term.c =================================================================== RCS file: /cvs/src/usr.bin/mandoc/mdoc_term.c,v retrieving revision 1.115 diff -u -p -r1.115 mdoc_term.c --- mdoc_term.c 6 Dec 2010 22:10:13 -0000 1.115 +++ mdoc_term.c 11 Dec 2010 23:58:41 -0000 @@ -2124,7 +2124,8 @@ termp_bk_pre(DECL_ARGS) case (MDOC_HEAD): return(0); case (MDOC_BODY): - p->flags |= TERMP_PREKEEP; + if (n->parent->args || 0 == n->prev->nchild) + p->flags |= TERMP_PREKEEP; break; default: abort(); -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv