From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout-kit-01.scc.kit.edu (scc-mailout-kit-01.scc.kit.edu [129.13.231.81]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id d54625a5 for ; Sat, 9 Feb 2019 11:05:36 -0500 (EST) Received: from asta-nat.asta.uni-karlsruhe.de ([172.22.63.82] helo=hekate.usta.de) by scc-mailout-kit-01.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1gsV8H-0007XW-O4; Sat, 09 Feb 2019 17:05:35 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1gsV8G-0003cn-Tq; Sat, 09 Feb 2019 17:05:32 +0100 Received: from athene.usta.de ([172.24.96.10]) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1gsV8G-0003mp-Kz; Sat, 09 Feb 2019 17:05:32 +0100 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id 1c3166f5; Sat, 9 Feb 2019 17:05:32 +0100 (CET) Date: Sat, 9 Feb 2019 17:05:32 +0100 From: Ingo Schwarze To: "Anthony J. Bentley" Cc: tech@mandoc.bsd.lv Subject: Re: Comments within tables Message-ID: <20190209160532.GC37934@athene.usta.de> References: <16677.1549668230@desktop.ajb.soy> X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16677.1549668230@desktop.ajb.soy> User-Agent: Mutt/1.8.0 (2017-02-23) Hi Anthony, Anthony J. Bentley wrote on Fri, Feb 08, 2019 at 04:23:50PM -0700: > Just noticed this while playing around. > > .TS > box; > n n n n. > .\"_ _ _ _ > 2173 77.1 13765 53.6 > .\"= = = = > .TE > > groff: > > +---------------------------+ > |2173 77.1 13765 53.6 | > +---------------------------+ > > mandoc: > > +---------------------------+ > | . | > |2173 77.1 13765 53.6 | > | . | > +---------------------------+ True, fixed in the commit below. Care was needed to not break this earlier commit to roff.c: revision 1.124 date: 2015/01/21 02:16:11; author: schwarze; state: Exp; lines: +10 -11 pass empty request lines through to tbl(7); sometimes, they end a layout Yours, Ingo Log Message: ----------- ignore empty request lines in the table data reader; fixing a minibug reported by bentley@ Modified Files: -------------- mandoc: tbl_data.c Revision Data ------------- Index: tbl_data.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/tbl_data.c,v retrieving revision 1.51 retrieving revision 1.52 diff -Ltbl_data.c -Ltbl_data.c -u -p -r1.51 -r1.52 --- tbl_data.c +++ tbl_data.c @@ -1,7 +1,7 @@ /* $Id$ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2011, 2015, 2017, 2018 Ingo Schwarze + * Copyright (c) 2011,2015,2017,2018,2019 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -248,14 +248,27 @@ tbl_data(struct tbl_node *tbl, int ln, c assert(rp != NULL); - if ( ! strcmp(p, "_")) { - sp = newspan(tbl, ln, rp); - sp->pos = TBL_SPAN_HORIZ; - return; - } else if ( ! strcmp(p, "=")) { - sp = newspan(tbl, ln, rp); - sp->pos = TBL_SPAN_DHORIZ; - return; + if (p[1] == '\0') { + switch (p[0]) { + case '.': + /* + * Empty request lines must be handled here + * and cannot be discarded in roff_parseln() + * because in the layout section, they + * are significant and end the layout. + */ + return; + case '_': + sp = newspan(tbl, ln, rp); + sp->pos = TBL_SPAN_HORIZ; + return; + case '=': + sp = newspan(tbl, ln, rp); + sp->pos = TBL_SPAN_DHORIZ; + return; + default: + break; + } } /* -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv