Bug 343102: cleanup patch for the original fix, r=mscott, sr=neil

This commit is contained in:
gavin%gavinsharp.com 2006-10-16 17:02:54 +00:00
Родитель 102c371013
Коммит a33a4b28b3
1 изменённых файлов: 6 добавлений и 13 удалений

Просмотреть файл

@ -100,6 +100,11 @@ mime_decode_qp_buffer (MimeDecoderData *data, const char *buffer, PRInt32 length
trailing whitespace which remains must have been introduced
by a stupid gateway. */
/* Treat null bytes as spaces when format_out is
nsMimeOutput::nsMimeMessageBodyDisplay (see bug 243199 comment 7) */
PRBool treatNullAsSpace = data->objectToDecode &&
data->objectToDecode->options->format_out == nsMimeOutput::nsMimeMessageBodyDisplay;
while (length > 0 || i != 0)
{
while (i < 3 && length > 0)
@ -177,20 +182,8 @@ mime_decode_qp_buffer (MimeDecoderData *data, const char *buffer, PRInt32 length
if (in > out) *out++ = token[2];
continue;
}
/* treat null bytes as spaces per bug 243199 comment 7 */
/* treat null bytes as null if data->objectToDecode is null
* Reason: Null bytes shall only be displayed as " " when format_out equals nsMimeOutput::nsMimeMessageBodyDisplay
* Bug 344102
*/
*out++ = c
||(
(
data->objectToDecode &&
data->objectToDecode->options->format_out != nsMimeOutput::nsMimeMessageBodyDisplay
) || (! (data->objectToDecode ))
) ? (char) c : ' ';
*out++ = c ? (char) c : ((treatNullAsSpace) ? ' ' : (char) c);
}
else
{