aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/editfns.c7
1 files changed, 6 insertions, 1 deletions
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.")
154 CHECK_STRING (string, 0); 154 CHECK_STRING (string, 0);
155 p = XSTRING (string); 155 p = XSTRING (string);
156 if (p->size) 156 if (p->size)
157 XSETFASTINT (val, STRING_CHAR (p->data, STRING_BYTES (p))); 157 {
158 if (STRING_MULTIBYTE (string))
159 XSETFASTINT (val, STRING_CHAR (p->data, STRING_BYTES (p)));
160 else
161 XSETFASTINT (val, p->data[0]);
162 }
158 else 163 else
159 XSETFASTINT (val, 0); 164 XSETFASTINT (val, 0);
160 return val; 165 return val;