diff options
| author | Kenichi Handa | 2003-02-17 00:33:01 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2003-02-17 00:33:01 +0000 |
| commit | fb4452cc3205120d4f8d515083474d9bd05daa43 (patch) | |
| tree | eeb3e50a9cbac5d596b3cb89224404ec953b93ee /src | |
| parent | f0d73ec43574b4a9a2d1f88485d15531ec0e4769 (diff) | |
| download | emacs-fb4452cc3205120d4f8d515083474d9bd05daa43.tar.gz emacs-fb4452cc3205120d4f8d515083474d9bd05daa43.zip | |
(string_to_multibyte): Always return a multibyte string.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/fns.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 877a73c2657..535558bee2d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2003-02-17 Kenichi Handa <handa@m17n.org> | ||
| 2 | |||
| 3 | * fns.c (string_to_multibyte): Always return a multibyte string. | ||
| 4 | |||
| 1 | 2003-02-16 Jason Rumney <jasonr@gnu.org> | 5 | 2003-02-16 Jason Rumney <jasonr@gnu.org> |
| 2 | 6 | ||
| 3 | * w32fns.c (w32_list_bdf_fonts, w32_list_fonts): Negative | 7 | * w32fns.c (w32_list_bdf_fonts, w32_list_fonts): Negative |
| @@ -1053,10 +1053,10 @@ string_to_multibyte (string) | |||
| 1053 | return string; | 1053 | return string; |
| 1054 | 1054 | ||
| 1055 | nbytes = parse_str_to_multibyte (SDATA (string), SBYTES (string)); | 1055 | nbytes = parse_str_to_multibyte (SDATA (string), SBYTES (string)); |
| 1056 | /* If all the chars are ASCII, they won't need any more bytes | 1056 | /* If all the chars are ASCII or eight-bit-graphic, they won't need |
| 1057 | once converted. In that case, we can return STRING itself. */ | 1057 | any more bytes once converted. */ |
| 1058 | if (nbytes == SBYTES (string)) | 1058 | if (nbytes == SBYTES (string)) |
| 1059 | return string; | 1059 | return make_multibyte_string (SDATA (string), nbytes, nbytes); |
| 1060 | 1060 | ||
| 1061 | buf = (unsigned char *) alloca (nbytes); | 1061 | buf = (unsigned char *) alloca (nbytes); |
| 1062 | bcopy (SDATA (string), buf, SBYTES (string)); | 1062 | bcopy (SDATA (string), buf, SBYTES (string)); |