]> code.delx.au - gnu-emacs/commitdiff
[andrewi]
authorAndrew Innes <andrewi@gnu.org>
Sun, 2 May 1999 10:05:22 +0000 (10:05 +0000)
committerAndrew Innes <andrewi@gnu.org>
Sun, 2 May 1999 10:05:22 +0000 (10:05 +0000)
(decode_eol): Set produced/consumed values to zero if
src_bytes is <= 0 on entry.

[handa]
(setup_raw_text_coding_system): Call
setup_coding_system to initialize the fields of struct
coding_system correctly.

src/coding.c

index 363af3561f402df4e81ace37b5f9843b973fe3f8..8b2bf7cac3dea0a1c1aba61e4d775ab77f9155a0 100644 (file)
@@ -2577,7 +2577,11 @@ decode_eol (coding, source, destination, src_bytes, dst_bytes)
   coding->fake_multibyte = 0;
 
   if (src_bytes <= 0)
-    return result;
+    {
+      coding->produced = coding->produced_char = 0;
+      coding->consumed = coding->consumed_char = 0;
+      return result;
+    }
 
   switch (coding->eol_type)
     {
@@ -3240,6 +3244,7 @@ setup_raw_text_coding_system (coding)
            coding->symbol
              = XVECTOR (subsidiaries)->contents[coding->eol_type];
        }
+      setup_coding_system (coding->symbol, coding);
     }
   return;
 }