From: Kenichi Handa Date: Mon, 7 Sep 1998 13:39:15 +0000 (+0000) Subject: (STRING_CHAR_AND_LENGTH): Return correct value in X-Git-Tag: emacs-20.4~1747 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8783b77f5b102e14378a759d556cae4cdf3efc2b;p=emacs.git (STRING_CHAR_AND_LENGTH): Return correct value in ACTUAL_LEN even if LEN is too short to have a valid multibyte form. (STRING_CHAR_AND_CHAR_LENGTH): Likewise. --- diff --git a/src/charset.h b/src/charset.h index d2fd94e6ade..b25e66a5632 100644 --- a/src/charset.h +++ b/src/charset.h @@ -587,16 +587,14 @@ extern int iso_charset_table[2][2][128]; MULTIBYTE_FORM_LENGTH. */ #define STRING_CHAR_AND_LENGTH(str, len, actual_len) \ - ((BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) == 1 \ - || BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) > (len)) \ + (BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) == 1 \ ? (actual_len = 1), (unsigned char) *(str) \ : string_to_non_ascii_char (str, len, &actual_len, 0)) /* This is like STRING_CHAR_AND_LENGTH but the third arg ACTUAL_LEN does not include garbage bytes following the multibyte character. */ -#define STRING_CHAR_AND_CHAR_LENGTH(str, len, actual_len) \ - ((BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) == 1 \ - || BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) > (len)) \ +#define STRING_CHAR_AND_CHAR_LENGTH(str, len, actual_len) \ + (BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) == 1 \ ? (actual_len = 1), (unsigned char) *(str) \ : string_to_non_ascii_char (str, len, &actual_len, 1))