From: Kenichi Handa Date: Wed, 21 Aug 2002 02:28:21 +0000 (+0000) Subject: (base64_decode_1): Insert eight-bit chars correctly. X-Git-Tag: emacs-pretest-23.0.90~8295^2~1864^2~400 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5a38b8c5ed3769ae8e6d5383a20c75ac717e9414;p=emacs.git (base64_decode_1): Insert eight-bit chars correctly. --- diff --git a/src/fns.c b/src/fns.c index 5133f32a5dc..2a442816405 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3263,8 +3263,8 @@ base64_decode_1 (from, to, length, multibyte, nchars_return) value |= base64_char_to_value[c] << 12; c = (unsigned char) (value >> 16); - if (multibyte) - e += CHAR_STRING (c, e); + if (multibyte && c >= 128) + e += BYTE8_STRING (c, e); else *e++ = c; nchars++; @@ -3287,8 +3287,8 @@ base64_decode_1 (from, to, length, multibyte, nchars_return) value |= base64_char_to_value[c] << 6; c = (unsigned char) (0xff & value >> 8); - if (multibyte) - e += CHAR_STRING (c, e); + if (multibyte && c >= 128) + e += BYTE8_STRING (c, e); else *e++ = c; nchars++; @@ -3305,8 +3305,8 @@ base64_decode_1 (from, to, length, multibyte, nchars_return) value |= base64_char_to_value[c]; c = (unsigned char) (0xff & value); - if (multibyte) - e += CHAR_STRING (c, e); + if (multibyte && c >= 128) + e += BYTE8_STRING (c, e); else *e++ = c; nchars++;