[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] corruption when attaching all-null files
From: |
Paul Fox |
Subject: |
Re: [Nmh-workers] corruption when attaching all-null files |
Date: |
Sun, 11 May 2014 20:16:01 -0400 |
ralph wrote:
> Hi Paul,
>
> > here's the place where the new "containsnul" is used, for CT_TEXT and
> > CT_APPLICATION.
> ...
> > case CT_TEXT:
> > if (contains8bit && !containsnul && !linelen && !linespace &&
> > !checksw)
> > ct->c_encoding = CE_8BIT;
> > else if (contains8bit || containsnul || linelen || linespace
> > || checksw)
> > ct->c_encoding = CE_QUOTED;
> > else
> > ct->c_encoding = CE_7BIT;
> > break;
>
> The duplication of contains8bit seems overly complex.
>
> case CT_TEXT:
> if (contains8bit)
> ct->c_encoding = (containsnul || linelen || linespace ||
> checksw) ?
> CE_QUOTED : CE_8BIT;
> else
> ct->c_encoding = CE_7BIT;
i agree that the logic is cumbersome, but that doesn't look like a correct
translation to me. how about this:
needs_q_p = (containsnul || linelen || linespace || checksw);
...
case CT_TEXT:
if (needs_q_p)
ct->c_encoding = CE_QUOTED;
else if (contains8bit)
ct->c_encoding = CE_8BIT;
else
ct->c_encoding = CE_7BIT;
=----------------------
paul fox, address@hidden (arlington, ma, where it's 66.0 degrees)
- Re: [Nmh-workers] corruption when attaching all-null files, (continued)
Re: [Nmh-workers] corruption when attaching all-null files, David Levine, 2014/05/07
Re: [Nmh-workers] corruption when attaching all-null files, David Levine, 2014/05/07
Re: [Nmh-workers] corruption when attaching all-null files, David Levine, 2014/05/07