From: Kenichi Handa Date: Thu, 15 Jan 2004 11:31:57 +0000 (+0000) Subject: (Freplace_match): Use make_multibyte_string or X-Git-Tag: ttn-vms-21-2-B4~7930 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8046052576e208af420cf72646a99b4d1cefa02a;p=emacs.git (Freplace_match): Use make_multibyte_string or make_unibyte_string according to the buffer multibyteness. --- diff --git a/src/ChangeLog b/src/ChangeLog index 1b662507358..8914c65e41f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-01-15 Kenichi Handa + + * search.c (Freplace_match): Use make_multibyte_string or + make_unibyte_string according to the buffer multibyteness. + 2004-01-14 Stefan Monnier * 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. */) } if (really_changed) - newtext = make_string (substed, substed_len); + { + if (buf_multibyte) + { + int nchars = multibyte_chars_in_text (substed, substed_len); + newtext = make_multibyte_string (substed, nchars, substed_len); + } + else + newtext = make_unibyte_string (substed, substed_len); + } xfree (substed); }