]> git.eshelyaron.com Git - emacs.git/commitdiff
(ccl_coding_driver): Setup ccl->last_block properly.
authorKenichi Handa <handa@m17n.org>
Tue, 18 Aug 1998 13:15:18 +0000 (13:15 +0000)
committerKenichi Handa <handa@m17n.org>
Tue, 18 Aug 1998 13:15:18 +0000 (13:15 +0000)
(setup_coding_system): Correctly setup `valid_codes' member.

src/coding.c

index e9227a2ac7b2bd4fa91d44a326fa367bd9693db7..f44a0a09d40f3bde3ec780573e7c4a3641ded902 100644 (file)
@@ -3086,8 +3086,9 @@ setup_coding_system (coding_system, coding)
          {
            Lisp_Object this;
 
-           for (this = XCONS (val)->car; CONSP (val); val = XCONS (val)->cdr)
+           for (; CONSP (val); val = XCONS (val)->cdr)
              {
+               this = XCONS (val)->car;
                if (INTEGERP (this)
                    && XINT (this) >= 0 && XINT (this) < 256)
                  coding->spec.ccl.valid_codes[XINT (this)] = 1;
@@ -3606,6 +3607,9 @@ ccl_coding_driver (coding, source, destination, src_bytes, dst_bytes, encodep)
     = encodep ? &coding->spec.ccl.encoder : &coding->spec.ccl.decoder;
   int result;
 
+  if (encodep)
+    ccl->last_block = coding->mode & CODING_MODE_LAST_BLOCK;
+
   coding->produced = ccl_driver (ccl, source, destination,
                                 src_bytes, dst_bytes, &(coding->consumed));
   if (encodep)