# HG changeset patch # User Kenichi Handa # Date 913696538 0 # Node ID 2d62a16117512da41e0756ed7e0cd209ef06c841 # Parent 8d2f38338c816ec48813b829cb72c3aa48583d29 (string_char_to_byte): Handle invalid multibyte sequence correctly. (string_byte_to_char): Likesize. diff -r 8d2f38338c81 -r 2d62a1611751 src/fns.c --- a/src/fns.c Tue Dec 15 04:35:38 1998 +0000 +++ b/src/fns.c Tue Dec 15 04:35:38 1998 +0000 @@ -845,7 +845,7 @@ while (best_above_byte > 0 && !CHAR_HEAD_P (XSTRING (string)->data[best_above_byte])) best_above_byte--; - if (XSTRING (string)->data[best_above_byte] < 0x80) + if (!BASE_LEADING_CODE_P (XSTRING (string)->data[best_above_byte])) best_above_byte = best_above_byte_saved; best_above--; } @@ -911,7 +911,7 @@ while (best_above_byte > 0 && !CHAR_HEAD_P (XSTRING (string)->data[best_above_byte])) best_above_byte--; - if (XSTRING (string)->data[best_above_byte] < 0x80) + if (!BASE_LEADING_CODE_P (XSTRING (string)->data[best_above_byte])) best_above_byte = best_above_byte_saved; best_above--; }