Mercurial > emacs
comparison src/search.c @ 53587:6feb1f3f7a9b
(Freplace_match): Use make_multibyte_string or
make_unibyte_string according to the buffer multibyteness.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Thu, 15 Jan 2004 11:31:37 +0000 |
parents | 695cf19ef79e |
children | 824b5057fbca |
comparison
equal
deleted
inserted
replaced
53586:c242b125b405 | 53587:6feb1f3f7a9b |
---|---|
2551 substed_len += add_len; | 2551 substed_len += add_len; |
2552 } | 2552 } |
2553 } | 2553 } |
2554 | 2554 |
2555 if (really_changed) | 2555 if (really_changed) |
2556 newtext = make_string (substed, substed_len); | 2556 { |
2557 | 2557 if (buf_multibyte) |
2558 { | |
2559 int nchars = multibyte_chars_in_text (substed, substed_len); | |
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 |
2561 /* Replace the old text with the new in the cleanest possible way. */ | 2569 /* Replace the old text with the new in the cleanest possible way. */ |
2562 replace_range (search_regs.start[sub], search_regs.end[sub], | 2570 replace_range (search_regs.start[sub], search_regs.end[sub], |