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 p0G3rirx018381 for ; Sat, 15 Jan 2011 22:53:45 -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 1PeJgU-00006Z-Ay; Sun, 16 Jan 2011 04:53:42 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1PeJgU-00042e-8k for tech@mdocml.bsd.lv; Sun, 16 Jan 2011 04:53:42 +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 1PeJgU-0000rR-7J for tech@mdocml.bsd.lv; Sun, 16 Jan 2011 04:53:42 +0100 Received: from schwarze by usta.de with local (Exim 4.72) (envelope-from ) id 1PeJgU-0003G9-6X for tech@mdocml.bsd.lv; Sun, 16 Jan 2011 04:53:42 +0100 Date: Sun, 16 Jan 2011 04:53:42 +0100 From: Ingo Schwarze To: tech@mdocml.bsd.lv Subject: Re: mdocml: Make -man -Tascii not break within literal lines Message-ID: <20110116035342.GE28336@iris.usta.de> References: <201101121523.p0CFNQNx028921@krisdoz.my.domain> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201101121523.p0CFNQNx028921@krisdoz.my.domain> User-Agent: Mutt/1.5.21 (2010-09-15) Hi Kristaps, this one caused my regression test suite to segfault - specifically the test having a blank line inside literal context died. kristaps@mdocml.bsd.lv wrote on Wed, Jan 12, 2011 at 10:23:26AM -0500: > Log Message: > ----------- > Make -man -Tascii not break within literal lines, e.g., > > .nf > .B hello world > .fi > > Also, clean up the print_man_node() function a little bit. This problem > has long since been in the TODO and was recently noted again by Brad > Smith. The -T[x]html fix will follow... > > Modified Files: > -------------- > mdocml: > man_term.c > > Revision Data > ------------- > Index: man_term.c > =================================================================== > RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_term.c,v > retrieving revision 1.96 > retrieving revision 1.97 > diff -Lman_term.c -Lman_term.c -u -p -r1.96 -r1.97 > --- man_term.c > +++ man_term.c > @@ -855,23 +855,31 @@ print_man_node(DECL_ARGS) > size_t rm, rmax; > int c; > > - c = 1; > - > switch (n->type) { > case(MAN_TEXT): > + /* > + * If we have a blank line, output a vertical space. > + * If we have a space as the first character, break > + * before printing the line's data. > + */ > if ('\0' == *n->string) { > term_vspace(p); > break; Here is the problem. After your refactoring, this should now read "return". OK? Index: man_term.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_term.c,v retrieving revision 1.97 diff -u -p -r1.97 man_term.c --- man_term.c 12 Jan 2011 15:23:25 -0000 1.97 +++ man_term.c 16 Jan 2011 03:49:36 -0000 @@ -1,6 +1,6 @@ /* $Id: man_term.c,v 1.97 2011/01/12 15:23:25 kristaps Exp $ */ /* - * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons + * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2011 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any @@ -864,7 +864,7 @@ print_man_node(DECL_ARGS) */ if ('\0' == *n->string) { term_vspace(p); - break; + return; } else if (' ' == *n->string && MAN_LINE & n->flags) term_newln(p); -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv