From d9d851ea28739e13689a4779ef624f835f8aef5f Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 6 Nov 1998 00:44:16 +0000 Subject: [PATCH] (Fstring_to_char): Don't return a multibyte character if STRING is a unibyte string. --- src/editfns.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/editfns.c b/src/editfns.c index bf3eebb5247..495ffb4a56a 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -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; -- 2.39.2