Re: What happened to strict_mime?
On 2007-03-20 12:01:49 +0900, TAKAHASHI Tamotsu wrote:
Why on earth do we need two different behaviors for encoding or
decoding subject headers as far as whitespace is concerned? There's
a spec-compliant way to do this, let's do that, and be done with.
If the other approach is really needed to deal with widespread
breakage (I don't think it is), implement that, and implement it
As an aside, the code used to implement this (in the instance around
line 816 of rfc2047.c) looks like an incredibly convoluted and
inefficient way of saying something like this:
if (islwsp (*s))
*d = ' ';
while (islwsp (*s) && *s)
Going further through the current code of rfc2047.c, the
AssumedCharset related code says things like:
n = mutt_strlen (s);
t = safe_malloc (n + 1);
strfcpy (t, s, n + 1);
That's usually spelled as
t = safe_strdup (s);
in mutt code.
Also, the current code doesn't seem to have a single opinion as to
what the prototype of mutt_get_default_charset() looks like.
The way in which this code iterates through AssumedCharset in
convert_nonmime_string is clumsy at best. (A better way to go
through it would be to safe_strdup() the entire thing, use strtok on
the copy, and then free the temporary buffer.)
So, from a casual glance at this code, two suggestions:
- Please clean up this code.
- Please throw out the whitespace-skipping option.
Thomas Roessler <roessler@xxxxxxxxxxxxxxxxxx>