From: Kristaps Dzonsons <kristaps@bsd.lv>
To: tech@mdocml.bsd.lv
Subject: Re: roff.c question
Date: Fri, 10 Dec 2010 10:40:52 +0100 [thread overview]
Message-ID: <4D01F5A4.8010300@bsd.lv> (raw)
In-Reply-To: <20101208010527.GA25360@iris.usta.de>
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
next prev parent reply other threads:[~2010-12-10 9:41 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-01 16:33 exit_status persistence Kristaps Dzonsons
2010-12-01 16:41 ` Kristaps Dzonsons
2010-12-01 21:28 ` Ingo Schwarze
2010-12-02 10:51 ` exit_status persistence (now: roff.c question) Kristaps Dzonsons
2010-12-02 13:29 ` Kristaps Dzonsons
2010-12-02 22:50 ` roff.c question Ingo Schwarze
2010-12-03 21:49 ` Ingo Schwarze
2010-12-05 15:15 ` Kristaps Dzonsons
2010-12-08 1:05 ` Ingo Schwarze
2010-12-10 9:40 ` Kristaps Dzonsons [this message]
2010-12-10 20:45 ` Ingo Schwarze
2010-12-10 20:52 ` Joerg Sonnenberger
2010-12-10 21:10 ` Ingo Schwarze
2010-12-10 21:17 ` Joerg Sonnenberger
2010-12-10 23:12 ` Ingo Schwarze
2010-12-03 23:31 ` Ingo Schwarze
2010-12-05 15:17 ` Kristaps Dzonsons
2010-12-09 23:45 ` Ingo Schwarze
2010-12-10 9:32 ` Kristaps Dzonsons
2010-12-02 20:54 ` Ingo Schwarze
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D01F5A4.8010300@bsd.lv \
--to=kristaps@bsd.lv \
--cc=tech@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).