]> git.eshelyaron.com Git - emacs.git/commitdiff
(print_string): Check validity of a character.
authorKenichi Handa <handa@m17n.org>
Wed, 4 Nov 1998 10:53:14 +0000 (10:53 +0000)
committerKenichi Handa <handa@m17n.org>
Wed, 4 Nov 1998 10:53:14 +0000 (10:53 +0000)
(print): Likewise.

src/print.c

index ec340e2c91ded077c982aa9331a2a495999188b0..3723c79b6ddd85bdd9c2e3b6b8248e198c1d70a4 100644 (file)
@@ -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++];