]> git.eshelyaron.com Git - emacs.git/commitdiff
(Freplace_match): Use make_multibyte_string or
authorKenichi Handa <handa@m17n.org>
Thu, 15 Jan 2004 11:31:57 +0000 (11:31 +0000)
committerKenichi Handa <handa@m17n.org>
Thu, 15 Jan 2004 11:31:57 +0000 (11:31 +0000)
make_unibyte_string according to the buffer multibyteness.

src/ChangeLog
src/search.c

index 1b6625073585bb2909be4e2bbfdb6f2b780185e9..8914c65e41f5978ee90257ff4704b3eb27e10f2f 100644 (file)
@@ -1,3 +1,8 @@
+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)
index 538cb8dfa645d26f6862640a9f9997adfe8c13ec..020573b75a1e6abfb8a4318c6cd1a9826fed96c6 100644 (file)
@@ -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);
     }