# HG changeset patch # User Kenichi Handa # Date 1268705680 -32400 # Node ID cd151730b1604704e25b16a0e7449e20a8936df6 # Parent cea18e9685bf2127be33fa86745d901cd7d4e9b8 coding.c (decode_coding_ccl): Fix previous change for the multibyte case. diff -r cea18e9685bf -r cd151730b160 src/ChangeLog --- a/src/ChangeLog Tue Mar 16 10:04:20 2010 +0900 +++ b/src/ChangeLog Tue Mar 16 11:14:40 2010 +0900 @@ -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 -r cea18e9685bf -r cd151730b160 src/coding.c --- a/src/coding.c Tue Mar 16 10:04:20 2010 +0900 +++ b/src/coding.c Tue Mar 16 11:14:40 2010 +0900 @@ -5245,7 +5245,7 @@ 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 @@ 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 @@ 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;