# HG changeset patch # User Kenichi Handa # Date 910176794 0 # Node ID 8c829259606f7a534968ba44f87328588e030fff # Parent c4c37f5b8df68ba8fdf5980afbecaea9cdf74ef2 (print_string): Check validity of a character. (print): Likewise. diff -r c4c37f5b8df6 -r 8c829259606f src/print.c --- 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++];