From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mo-p00-ob.rzone.de (mo-p00-ob.rzone.de [81.169.146.160]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id p3QKAs8R022835 for ; Tue, 26 Apr 2011 16:10:55 -0400 (EDT) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/YPAwti93ltYhxHqcfQ== X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (dslb-088-072-198-082.pools.arcor-ip.net [88.72.198.82]) by post.strato.de (cohen mo4) (RZmta 25.17) with (DHE-RSA-AES128-SHA encrypted) ESMTPA id h07190n3QHvsDH for ; Tue, 26 Apr 2011 22:10:51 +0200 (MEST) Received: by britannica.bec.de (sSMTP sendmail emulation); Tue, 26 Apr 2011 22:10:50 +0200 Date: Tue, 26 Apr 2011 22:10:50 +0200 From: Joerg Sonnenberger To: discuss@mdocml.bsd.lv Subject: Re: tbl issues with 1.11.1 Message-ID: <20110426201050.GA5448@britannica.bec.de> References: <20110414014526.GB1280@darklight.org.ru> <20110416213413.GI13629@iris.usta.de> X-Mailinglist: mdocml-discuss Reply-To: discuss@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="tThc/1wpZn/ma/RB" Content-Disposition: inline In-Reply-To: <20110416213413.GI13629@iris.usta.de> User-Agent: Mutt/1.5.20 (2009-06-14) --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Apr 16, 2011 at 11:34:13PM +0200, Ingo Schwarze wrote: > > +------+------+ > > |HEAD1 |HEAD2 | > > |========+======| > > |cell1 |cell2 | > > +------+------+ > > > > Thanks for the very good report. > This does indeed look wrong. > The OpenBSD version is affected as well. Ingo, that's your change from January. Care to check the attached patch? It seems to compute the right column widths with one exception. If no | is used, GNU tbl(1) separates columns by an implicit " ", e.g. foo_ bar_ baz_ for left-aligned data. That's currently missing. Joerg --tThc/1wpZn/ma/RB Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="tbl-layout.diff" Index: out.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/out.c,v retrieving revision 1.40 diff -u -p -r1.40 out.c --- out.c 9 Apr 2011 15:29:40 -0000 1.40 +++ out.c 26 Apr 2011 20:07:03 -0000 @@ -293,7 +293,7 @@ tblcalc_literal(struct rofftbl *tbl, str case (TBL_CELL_LONG): /* FALLTHROUGH */ case (TBL_CELL_CENTRE): - bufsz = (*tbl->len)(1, tbl->arg); + bufsz = (*tbl->len)(2, tbl->arg); break; default: bufsz = (*tbl->len)(1, tbl->arg); Index: tbl_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/tbl_term.c,v retrieving revision 1.19 diff -u -p -r1.19 tbl_term.c --- tbl_term.c 25 Jan 2011 12:07:30 -0000 1.19 +++ tbl_term.c 26 Apr 2011 20:07:03 -0000 @@ -198,8 +198,6 @@ tbl_hrule(struct termp *tp, const struct width = tp->tbl.cols[hp->ident].width; switch (hp->pos) { case (TBL_HEAD_DATA): - if (hp->next) - width += 2; tbl_char(tp, c, width); break; case (TBL_HEAD_DVERT): @@ -375,9 +373,9 @@ tbl_literal(struct termp *tp, const stru break; case (TBL_CELL_CENTRE): padr = col->width - term_strlen(tp, dp->string); - if (3 > padr) + if (2 > padr) break; - padl = (padr - 1) / 2; + padl = padr / 2; padr -= padl; break; case (TBL_CELL_RIGHT): @@ -390,7 +388,7 @@ tbl_literal(struct termp *tp, const stru tbl_char(tp, ASCII_NBRSP, padl); term_word(tp, dp->string); - tbl_char(tp, ASCII_NBRSP, padr + 2); + tbl_char(tp, ASCII_NBRSP, padr); } static void --tThc/1wpZn/ma/RB-- -- To unsubscribe send an email to discuss+unsubscribe@mdocml.bsd.lv