From: Kenichi Handa Date: Tue, 16 Mar 2010 02:14:40 +0000 (+0900) Subject: coding.c (decode_coding_ccl): Fix previous change for the multibyte case. X-Git-Tag: emacs-pretest-23.1.95~67 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fbdc17211b56572046387d5fd9e80d96e3d07af4;p=emacs.git coding.c (decode_coding_ccl): Fix previous change for the multibyte case. --- diff --git a/src/ChangeLog b/src/ChangeLog index d8369bb9a20..9dc50960fbe 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-03-16 Kenichi Handa + + * coding.c (decode_coding_ccl): Fix previous change for the + multibyte case. + 2010-03-15 Andreas Politz (tiny change) * editfns.c (Fformat): Account for string precision when computing diff --git a/src/coding.c b/src/coding.c index df81eaba16e..a464950e8d1 100644 --- a/src/coding.c +++ b/src/coding.c @@ -5245,7 +5245,7 @@ decode_coding_ccl (coding) int multibytep = coding->src_multibyte; struct ccl_program *ccl = &coding->spec.ccl->ccl; int source_charbuf[1024]; - int source_byteidx[1024]; + int source_byteidx[1025]; Lisp_Object attrs, charset_list; CODING_GET_INFO (coding, attrs, charset_list); @@ -5256,11 +5256,14 @@ decode_coding_ccl (coding) int i = 0; if (multibytep) - while (i < 1024 && p < src_end) - { - source_byteidx[i] = p - src; - source_charbuf[i++] = STRING_CHAR_ADVANCE (p); - } + { + while (i < 1024 && p < src_end) + { + source_byteidx[i] = p - src; + source_charbuf[i++] = STRING_CHAR_ADVANCE (p); + } + source_byteidx[i] = p - src; + } else while (i < 1024 && p < src_end) source_charbuf[i++] = *p++; @@ -5270,7 +5273,7 @@ decode_coding_ccl (coding) ccl_driver (ccl, source_charbuf, charbuf, i, charbuf_end - charbuf, charset_list); charbuf += ccl->produced; - if (multibytep && ccl->consumed < i) + if (multibytep) src += source_byteidx[ccl->consumed]; else src += ccl->consumed;