]> git.eshelyaron.com Git - emacs.git/commitdiff
(Freplace_match): Fix for the unibyte case.
authorKenichi Handa <handa@m17n.org>
Tue, 20 Aug 2002 08:32:34 +0000 (08:32 +0000)
committerKenichi Handa <handa@m17n.org>
Tue, 20 Aug 2002 08:32:34 +0000 (08:32 +0000)
src/search.c

index 5ce999ef4d75abbdd1d033166c929d39faf771a2..efc1c35bdc2c6d3c056cf47affd753ea77e49ed9 100644 (file)
@@ -2245,14 +2245,20 @@ since only regular expressions have distinguished subexpressions.  */)
     {
       /* Decide how to casify by examining the matched text. */
       int last;
+      int multibyte;
 
       pos = search_regs.start[sub];
       last = search_regs.end[sub];
 
       if (NILP (string))
-       pos_byte = CHAR_TO_BYTE (pos);
+       {
+         pos_byte = CHAR_TO_BYTE (pos);
+         multibyte = ! NILP (current_buffer->enable_multibyte_characters);
       else
-       pos_byte = string_char_to_byte (string, pos);
+       {
+         pos_byte = string_char_to_byte (string, pos);
+         multibyte = STRING_MULTIBYTE (string);
+       }
 
       prevc = '\n';
       case_action = all_caps;
@@ -2273,6 +2279,10 @@ since only regular expressions have distinguished subexpressions.  */)
            }
          else
            FETCH_STRING_CHAR_ADVANCE (c, string, pos, pos_byte);
+         if (! multibyte)
+           {
+             MAKE_CHAR_MULTIBYTE (c);
+           }
 
          if (LOWERCASEP (c))
            {