From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-2.sys.kth.se (smtp-2.sys.kth.se [130.237.32.160]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id oBA9exbp024546 for ; Fri, 10 Dec 2010 04:41:00 -0500 (EST) Received: from mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) by smtp-2.sys.kth.se (Postfix) with ESMTP id 579ED14DCB1 for ; Fri, 10 Dec 2010 10:40:54 +0100 (CET) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-2.sys.kth.se ([130.237.32.160]) by mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) (amavisd-new, port 10024) with LMTP id W5ko-OdELL4g for ; Fri, 10 Dec 2010 10:40:52 +0100 (CET) X-KTH-Auth: kristaps [85.8.61.53] X-KTH-mail-from: kristaps@bsd.lv X-KTH-rcpt-to: tech@mdocml.bsd.lv Received: from h85-8-61-53.dynamic.se.alltele.net (h85-8-61-53.dynamic.se.alltele.net [85.8.61.53]) by smtp-2.sys.kth.se (Postfix) with ESMTP id B0D1E14DC75 for ; Fri, 10 Dec 2010 10:40:52 +0100 (CET) Message-ID: <4D01F5A4.8010300@bsd.lv> Date: Fri, 10 Dec 2010 10:40:52 +0100 From: Kristaps Dzonsons User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 To: tech@mdocml.bsd.lv Subject: Re: roff.c question References: <4CF678F0.6020304@bsd.lv> <20101201212834.GA22990@iris.usta.de> <4CF77A2B.6020702@bsd.lv> <4CF79F45.6080105@bsd.lv> <20101202225019.GD12188@iris.usta.de> <20101203214929.GB28384@iris.usta.de> <4CFBAC80.1060004@bsd.lv> <20101208010527.GA25360@iris.usta.de> In-Reply-To: <20101208010527.GA25360@iris.usta.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 08/12/2010 02:05, Ingo Schwarze wrote: > Hi Kristaps, > > Kristaps Dzonsons wrote on Sun, Dec 05, 2010 at 04:15:12PM +0100: >> Ingo wrote: > >>> 1) roff_res() should not expand \\* or \\\\*, >>> but it should expand \* and \\\*. >>> >>> OK for the following patch? > >> That's fine by me, > > Oh well, the patch was broken, fortunately i notived before > committing it. The problem was that it didn't make sure that > the '*' immediately followed the '\\'. > >> but let's please put some roff.7 documentation >> (and in-line) in place > > Actually, that's what made me find the problem. > Documenting code is often a good debugging strategy. > >> regarding this sort of chicanery. >> It confuses the hell out of me for one! > > At some point, i guess we will have to implement proper > roff copy mode - but not right now, we still have more > elementary problems to deal with. At that point, we > ought to improve roff(7) docs related to .ds and \*. > > For now, i suggest to add just one sentence. > > > See below for an updated patch. > As it is quite different form the previous one, > i'm not committing it right away, > but sending it again for review. > > It is not as long as it seems; that's just the comments! ;-) > Actually, the code is more straightforward and easier than > my first try and uses one automatic variable less. > > As my other patch depends on this one (not in the sense of > physical conflicts in the code, but logically), i need to > return to it when this has gone in. Ingo, Much more readable. I worry a bit about performance, as this is an often-called function: why the funny business looking for three non-nils then the escaped asterisk? Seems (it pseudo-C) for (cp = buf + pos; cpp = strstr(cp, "\\*"); cp++) if ('\0' == cpp[2]) continue; ... would be much clearer and faster. No? Thanks, Kristaps -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv