aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa2010-03-16 11:14:40 +0900
committerKenichi Handa2010-03-16 11:14:40 +0900
commitfbdc17211b56572046387d5fd9e80d96e3d07af4 (patch)
treee03966e23136d272c8688b5f4a3c167c8754c39b /src/coding.c
parent35cd7cd68e92e4f364bde2875a02780f2caf6197 (diff)
downloademacs-fbdc17211b56572046387d5fd9e80d96e3d07af4.tar.gz
emacs-fbdc17211b56572046387d5fd9e80d96e3d07af4.zip
coding.c (decode_coding_ccl): Fix previous change for the multibyte case.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c17
1 files changed, 10 insertions, 7 deletions
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)
5245 int multibytep = coding->src_multibyte; 5245 int multibytep = coding->src_multibyte;
5246 struct ccl_program *ccl = &coding->spec.ccl->ccl; 5246 struct ccl_program *ccl = &coding->spec.ccl->ccl;
5247 int source_charbuf[1024]; 5247 int source_charbuf[1024];
5248 int source_byteidx[1024]; 5248 int source_byteidx[1025];
5249 Lisp_Object attrs, charset_list; 5249 Lisp_Object attrs, charset_list;
5250 5250
5251 CODING_GET_INFO (coding, attrs, charset_list); 5251 CODING_GET_INFO (coding, attrs, charset_list);
@@ -5256,11 +5256,14 @@ decode_coding_ccl (coding)
5256 int i = 0; 5256 int i = 0;
5257 5257
5258 if (multibytep) 5258 if (multibytep)
5259 while (i < 1024 && p < src_end) 5259 {
5260 { 5260 while (i < 1024 && p < src_end)
5261 source_byteidx[i] = p - src; 5261 {
5262 source_charbuf[i++] = STRING_CHAR_ADVANCE (p); 5262 source_byteidx[i] = p - src;
5263 } 5263 source_charbuf[i++] = STRING_CHAR_ADVANCE (p);
5264 }
5265 source_byteidx[i] = p - src;
5266 }
5264 else 5267 else
5265 while (i < 1024 && p < src_end) 5268 while (i < 1024 && p < src_end)
5266 source_charbuf[i++] = *p++; 5269 source_charbuf[i++] = *p++;
@@ -5270,7 +5273,7 @@ decode_coding_ccl (coding)
5270 ccl_driver (ccl, source_charbuf, charbuf, i, charbuf_end - charbuf, 5273 ccl_driver (ccl, source_charbuf, charbuf, i, charbuf_end - charbuf,
5271 charset_list); 5274 charset_list);
5272 charbuf += ccl->produced; 5275 charbuf += ccl->produced;
5273 if (multibytep && ccl->consumed < i) 5276 if (multibytep)
5274 src += source_byteidx[ccl->consumed]; 5277 src += source_byteidx[ccl->consumed];
5275 else 5278 else
5276 src += ccl->consumed; 5279 src += ccl->consumed;