aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa2002-05-22 11:30:00 +0000
committerKenichi Handa2002-05-22 11:30:00 +0000
commitacb2a965175803af0d94d53f1e8b787b3eec176c (patch)
tree5989dce078eba6534eefef4ca1863f404ea0a57c /src/coding.c
parentc7c66a958b9fa28878a8a5ff01aded1981a06f36 (diff)
downloademacs-acb2a965175803af0d94d53f1e8b787b3eec176c.tar.gz
emacs-acb2a965175803af0d94d53f1e8b787b3eec176c.zip
(decode_coding_charset): Fix previous change.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c40
1 files changed, 8 insertions, 32 deletions
diff --git a/src/coding.c b/src/coding.c
index 4553cae60e5..a36f877d80c 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -4336,8 +4336,8 @@ decode_coding_charset (coding)
4336 Lisp_Object val; 4336 Lisp_Object val;
4337 struct charset *charset; 4337 struct charset *charset;
4338 int dim; 4338 int dim;
4339 unsigned code; 4339 int len = 1;
4340 int c1; 4340 unsigned code = c;
4341 4341
4342 val = AREF (valids, c); 4342 val = AREF (valids, c);
4343 if (NILP (val)) 4343 if (NILP (val))
@@ -4346,21 +4346,10 @@ decode_coding_charset (coding)
4346 { 4346 {
4347 charset = CHARSET_FROM_ID (XFASTINT (val)); 4347 charset = CHARSET_FROM_ID (XFASTINT (val));
4348 dim = CHARSET_DIMENSION (charset); 4348 dim = CHARSET_DIMENSION (charset);
4349 code = c; 4349 while (len++ < dim)
4350 if (dim > 1)
4351 { 4350 {
4352 ONE_MORE_BYTE (c1); 4351 ONE_MORE_BYTE (c);
4353 code = (code << 8) | c1; 4352 code = (code << 8) | c;
4354 if (dim > 2)
4355 {
4356 ONE_MORE_BYTE (c1);
4357 code = (code << 8) | c1;
4358 if (dim > 3)
4359 {
4360 ONE_MORE_BYTE (c1);
4361 code = (c << 8) | c1;
4362 }
4363 }
4364 } 4353 }
4365 CODING_DECODE_CHAR (coding, src, src_base, src_end, 4354 CODING_DECODE_CHAR (coding, src, src_base, src_end,
4366 charset, code, c); 4355 charset, code, c);
@@ -4370,28 +4359,15 @@ decode_coding_charset (coding)
4370 /* VAL is a list of charset IDs. It is assured that the 4359 /* VAL is a list of charset IDs. It is assured that the
4371 list is sorted by charset dimensions (smaller one 4360 list is sorted by charset dimensions (smaller one
4372 comes first). */ 4361 comes first). */
4373 int b[4];
4374 int len = 1;
4375
4376 b[0] = c;
4377 /* VAL is a list of charset IDs. */
4378 while (CONSP (val)) 4362 while (CONSP (val))
4379 { 4363 {
4380 charset = CHARSET_FROM_ID (XFASTINT (XCAR (val))); 4364 charset = CHARSET_FROM_ID (XFASTINT (XCAR (val)));
4381 dim = CHARSET_DIMENSION (charset); 4365 dim = CHARSET_DIMENSION (charset);
4382 while (len < dim) 4366 while (len++ < dim)
4383 { 4367 {
4384 ONE_MORE_BYTE (c1); 4368 ONE_MORE_BYTE (c);
4385 b[len++] = c1; 4369 code = (code << 8) | c;
4386 } 4370 }
4387 if (dim == 1)
4388 code = b[0];
4389 else if (dim == 2)
4390 code = (b[0] << 8) | b[1];
4391 else if (dim == 3)
4392 code = (b[0] << 16) | (b[1] << 8) | b[2];
4393 else
4394 code = (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3];
4395 CODING_DECODE_CHAR (coding, src, src_base, 4371 CODING_DECODE_CHAR (coding, src, src_base,
4396 src_end, charset, code, c); 4372 src_end, charset, code, c);
4397 if (c >= 0) 4373 if (c >= 0)