Commit 8783b77f authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(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.
parent 69f76525
......@@ -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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment