]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fstring_to_char): Don't return a multibyte character
authorKenichi Handa <handa@m17n.org>
Fri, 6 Nov 1998 00:44:16 +0000 (00:44 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 6 Nov 1998 00:44:16 +0000 (00:44 +0000)
if STRING is a unibyte string.

src/editfns.c

index bf3eebb5247303048026500c20410c8ca3dc43a0..495ffb4a56a2ef2a244dff9a8ae2153b367f30c4 100644 (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;