diff options
| author | Kenichi Handa | 2004-01-15 11:31:57 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2004-01-15 11:31:57 +0000 |
| commit | 8046052576e208af420cf72646a99b4d1cefa02a (patch) | |
| tree | 2234743a66d5b2bca3430439a8a0c352a55ab3d6 /src | |
| parent | e75c1a57f7d262845b072f1789ca646fc952528f (diff) | |
| download | emacs-8046052576e208af420cf72646a99b4d1cefa02a.tar.gz emacs-8046052576e208af420cf72646a99b4d1cefa02a.zip | |
(Freplace_match): Use make_multibyte_string or
make_unibyte_string according to the buffer multibyteness.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/search.c | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1b662507358..8914c65e41f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2004-01-15 Kenichi Handa <handa@m17n.org> | ||
| 2 | |||
| 3 | * search.c (Freplace_match): Use make_multibyte_string or | ||
| 4 | make_unibyte_string according to the buffer multibyteness. | ||
| 5 | |||
| 1 | 2004-01-14 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2004-01-14 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * alloc.c (struct interval_block, struct string_block) | 8 | * alloc.c (struct interval_block, struct string_block) |
diff --git a/src/search.c b/src/search.c index 538cb8dfa64..020573b75a1 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -2553,8 +2553,16 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2553 | } | 2553 | } |
| 2554 | 2554 | ||
| 2555 | if (really_changed) | 2555 | if (really_changed) |
| 2556 | newtext = make_string (substed, substed_len); | 2556 | { |
| 2557 | if (buf_multibyte) | ||
| 2558 | { | ||
| 2559 | int nchars = multibyte_chars_in_text (substed, substed_len); | ||
| 2557 | 2560 | ||
| 2561 | newtext = make_multibyte_string (substed, nchars, substed_len); | ||
| 2562 | } | ||
| 2563 | else | ||
| 2564 | newtext = make_unibyte_string (substed, substed_len); | ||
| 2565 | } | ||
| 2558 | xfree (substed); | 2566 | xfree (substed); |
| 2559 | } | 2567 | } |
| 2560 | 2568 | ||