quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Quilt-dev] Re: ftw removed; emacs mode; translations; ready for 0.4


From: Jean Delvare
Subject: Re: [Quilt-dev] Re: ftw removed; emacs mode; translations; ready for 0.43?
Date: Fri, 3 Feb 2006 10:42:58 +0100

Hi John,

Please don't strip the Cc's!

> > Anyway, this code seems to be overly complicated in the first place.
> > What about this instead:
> >
> >         /^$/    { exit }
> >         END     { exit (not_mh) }
> >         !/^[A-Za-z-]+:[ \t]/    { not_mh=1 ; exit }
> >
> > Works for me and should be totally portable. John, can you please test
> > with Sun's /usr/xpg4/bin/awk for confirmation?
> 
> That passes through Sun awk ok, with the following test failure, which
> I assume is the one you expect to fail below.
> 
> [63] $ quilt mail --mbox mbox --prefix "test" --subject "This is a
> test" -m "Message" -- failed
> Unable to extract a subject header from patches/5.diff != ~

Yes, same one.

> > Note that the attached patch breaks the test suite. My analysis is that
> > the old awk code didn't work, and this hid a different bug in mail.in,
> > which we will now have to hunt for.
> 
> Agreed.

On further analysis, it appears that subject lines starting with "Re: "
or "Fwd: " will be erroneously detected as valid mail header lines.

Explicitely discarding "Re" and "Fwd" doesn't seem to be a good idea,
as different languages have different abreviations for these (e.g.
German have "Aw:" for reply, French have "Tr:" for forward) so we could
state that valid mail header keywords must be at least 4 characters
long, except for "To", "Cc" and possibly "Bcc". Attached is a patch
which does this (combined with the previous fix) so the test suite
passes again.

A different (and possibly more robust) approach would be to consider
the first paragraph a mail header block only if at least one of "To:",
"Cc:" or "From:" is found (in addition to the rule that only mail
headers must be found there.)

Comments?

-- 
Jean Delvare

Attachment: quilt-fix-awk-in-mail-2.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]