]> git.eshelyaron.com Git - emacs.git/commitdiff
(ccl_coding_driver): Initialize ccl->cr_consumed.
authorKenichi Handa <handa@m17n.org>
Thu, 21 Dec 2000 23:22:16 +0000 (23:22 +0000)
committerKenichi Handa <handa@m17n.org>
Thu, 21 Dec 2000 23:22:16 +0000 (23:22 +0000)
src/coding.c

index 18958564e524783faa1a2119edb45a3f7a214c54..10be961c3aa1efb0c7e8d77540a2931977e488ce 100644 (file)
@@ -4022,12 +4022,22 @@ ccl_coding_driver (coding, source, destination, src_bytes, dst_bytes, encodep)
 
   ccl->last_block = coding->mode & CODING_MODE_LAST_BLOCK;
   if (encodep)
-    ccl->eol_type = coding->eol_type;
+    {
+      /* On encoding, EOL format is converted within ccl_driver.  For
+        that, setup proper information in the structure CCL.  */
+      ccl->eol_type = coding->eol_type;
+      if (ccl->eol_type ==CODING_EOL_UNDECIDED)
+       ccl->eol_type = CODING_EOL_LF;
+      ccl->cr_consumed = coding->spec.ccl.cr_carryover;
+    }
   ccl->multibyte = coding->src_multibyte;
   coding->produced = ccl_driver (ccl, source, destination,
                                 src_bytes, dst_bytes, &(coding->consumed));
   if (encodep)
-    coding->produced_char = coding->produced;
+    {
+      coding->produced_char = coding->produced;
+      coding->spec.ccl.cr_carryover = ccl->cr_consumed;
+    }
   else
     {
       int bytes