changeset 36565:022c0e9f5e9b

(ccl_driver) <CCL_ReadMultibyteChar2>: Fix for the case that the source is unibyte.
author Kenichi Handa <handa@m17n.org>
date Tue, 06 Mar 2001 02:55:30 +0000
parents 427c9eef0c0c
children b021bb1f72f6
files src/ccl.c
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ccl.c	Tue Mar 06 02:54:50 2001 +0000
+++ b/src/ccl.c	Tue Mar 06 02:55:30 2001 +0000
@@ -1248,6 +1248,16 @@
 		  goto ccl_read_multibyte_character_suspend;
 		}
 	      
+	      if (!ccl->multibyte)
+		{
+		  int bytes;
+		  if (!UNIBYTE_STR_AS_MULTIBYTE_P (src, src_end - src, bytes))
+		    {
+		      reg[RRR] = CHARSET_8_BIT_CONTROL;
+		      reg[rrr] = *src++;
+		      break;
+		    }
+		}
 	      i = *src++;
 	      if (i == '\n' && ccl->eol_type != CODING_EOL_LF)
 		{
@@ -1335,6 +1345,12 @@
 	      break;
 
 	    ccl_read_multibyte_character_suspend:
+	      if (src <= src_end && !ccl->multibyte && ccl->last_block)
+		{
+		  reg[RRR] = CHARSET_8_BIT_CONTROL;
+		  reg[rrr] = i;
+		  break;
+		}
 	      src--;
 	      if (ccl->last_block)
 		{