1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-08 15:35:02 +00:00

(Fstring_to_char): Don't return a multibyte character

if STRING is a unibyte string.
This commit is contained in:
Kenichi Handa 1998-11-06 00:44:16 +00:00
parent a6c253264f
commit d9d851ea28

View File

@ -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;