changeset 23632:8c829259606f

(print_string): Check validity of a character. (print): Likewise.
author Kenichi Handa <handa@m17n.org>
date Wed, 04 Nov 1998 10:53:14 +0000
parents c4c37f5b8df6
children 72e494670e20
files src/print.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/print.c	Wed Nov 04 10:53:14 1998 +0000
+++ b/src/print.c	Wed Nov 04 10:53:14 1998 +0000
@@ -635,7 +635,11 @@
 	    int len;
 	    int ch = STRING_CHAR_AND_CHAR_LENGTH (XSTRING (string)->data + i,
 						  size_byte - i, len);
-
+	    if (!CHAR_VALID_P (ch, 0))
+	      {
+		ch = XSTRING (string)->data[i];
+		len = 1;
+	      }
 	    PRINTCHAR (ch);
 	    i += len;
 	  }
@@ -1266,7 +1270,10 @@
 		{
 		  c = STRING_CHAR_AND_CHAR_LENGTH (str + i_byte,
 						   size_byte - i_byte, len);
-		  i_byte += len;
+		  if (CHAR_VALID_P (c, 0))
+		    i_byte += len;
+		  else
+		    c = str[i_byte++];
 		}
 	      else
 		c = str[i_byte++];