Commit d9d851ea authored by Kenichi Handa's avatar Kenichi Handa

(Fstring_to_char): Don't return a multibyte character

if STRING is a unibyte string.
parent a6c25326
......@@ -154,7 +154,12 @@ A multibyte character is handled correctly.")
CHECK_STRING (string, 0);
p = XSTRING (string);
if (p->size)
XSETFASTINT (val, STRING_CHAR (p->data, STRING_BYTES (p)));
{
if (STRING_MULTIBYTE (string))
XSETFASTINT (val, STRING_CHAR (p->data, STRING_BYTES (p)));
else
XSETFASTINT (val, p->data[0]);
}
else
XSETFASTINT (val, 0);
return val;
......
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