* src/xdisp.c (handle_composition_prop):
* src/editfns.c (styled_format): Don't call 'STRING_CHAR' on
unibyte strings. This avoids assertion violation in
'string_char_and_length'.
(cherry picked from commit
d52d6e1e106117eb4bba81a65e256e2e793037b6)
|| conversion == 'o' || conversion == 'x'
|| conversion == 'X'))
error ("Invalid format operation %%%c",
- STRING_CHAR ((unsigned char *) format - 1));
+ multibyte_format
+ ? STRING_CHAR ((unsigned char *) format - 1)
+ : *((unsigned char *) format - 1));
else if (! (FIXNUMP (arg) || ((BIGNUMP (arg) || FLOATP (arg))
&& conversion != 'c')))
error ("Format specifier doesn't match argument type");
pos_byte = IT_STRING_BYTEPOS (*it);
string = it->string;
s = SDATA (string) + pos_byte;
- it->c = STRING_CHAR (s);
+ if (STRING_MULTIBYTE (string))
+ it->c = STRING_CHAR (s);
+ else
+ it->c = *s;
}
else
{