diff options
| author | Kenichi Handa | 1998-11-06 00:44:16 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1998-11-06 00:44:16 +0000 |
| commit | d9d851ea28739e13689a4779ef624f835f8aef5f (patch) | |
| tree | e99b4546f9d6fe8c384acfd55aba86142b22bd96 | |
| parent | a6c253264f5ce1d39d506f8aed7cdd40b3bac747 (diff) | |
| download | emacs-d9d851ea28739e13689a4779ef624f835f8aef5f.tar.gz emacs-d9d851ea28739e13689a4779ef624f835f8aef5f.zip | |
(Fstring_to_char): Don't return a multibyte character
if STRING is a unibyte string.
| -rw-r--r-- | src/editfns.c | 7 |
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; |