From: Kenichi Handa Date: Wed, 4 Nov 1998 10:53:14 +0000 (+0000) Subject: (print_string): Check validity of a character. X-Git-Tag: emacs-20.4~1317 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=da1ad4e741771618cc1ec4c4952c46db04924f4f;p=emacs.git (print_string): Check validity of a character. (print): Likewise. --- diff --git a/src/print.c b/src/print.c index ec340e2c91d..3723c79b6dd 100644 --- a/src/print.c +++ b/src/print.c @@ -635,7 +635,11 @@ print_string (string, printcharfun) 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 @@ print (obj, printcharfun, escapeflag) { 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++];