diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fns.c | 14 |
1 files changed, 6 insertions, 8 deletions
| @@ -871,14 +871,12 @@ If STRING is multibyte, the result is STRING itself.") | |||
| 871 | { | 871 | { |
| 872 | if (! STRING_MULTIBYTE (string)) | 872 | if (! STRING_MULTIBYTE (string)) |
| 873 | { | 873 | { |
| 874 | int newlen = multibyte_chars_in_text (XSTRING (string)->data, | 874 | int nbytes = STRING_BYTES (XSTRING (string)); |
| 875 | STRING_BYTES (XSTRING (string))); | 875 | int newlen = multibyte_chars_in_text (XSTRING (string)->data, nbytes); |
| 876 | /* If all the chars are ASCII, STRING is already suitable. */ | 876 | |
| 877 | if (newlen != STRING_BYTES (XSTRING (string))) | 877 | string = Fcopy_sequence (string); |
| 878 | { | 878 | XSTRING (string)->size = newlen; |
| 879 | string = Fcopy_sequence (string); | 879 | XSTRING (string)->size_byte = nbytes; |
| 880 | XSTRING (string)->size = newlen; | ||
| 881 | } | ||
| 882 | } | 880 | } |
| 883 | return string; | 881 | return string; |
| 884 | } | 882 | } |