make_unibyte_string according to the buffer multibyteness.
+2004-01-15 Kenichi Handa <handa@m17n.org>
+
+ * search.c (Freplace_match): Use make_multibyte_string or
+ make_unibyte_string according to the buffer multibyteness.
+
2004-01-14 Stefan Monnier <monnier@iro.umontreal.ca>
* alloc.c (struct interval_block, struct string_block)
}
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);
}