]> git.eshelyaron.com Git - emacs.git/commitdiff
(re_search_2): Fix for the case of unibyte buffer.
authorKenichi Handa <handa@m17n.org>
Mon, 7 Oct 2002 12:59:21 +0000 (12:59 +0000)
committerKenichi Handa <handa@m17n.org>
Mon, 7 Oct 2002 12:59:21 +0000 (12:59 +0000)
src/ChangeLog
src/regex.c

index 47b7f90359b18c60b3d258537960194a5ed8b1e8..4b9400ab77d3ad1eec77743f65373e424e1b73a8 100644 (file)
@@ -1,3 +1,10 @@
+2002-10-07  Kenichi Handa  <handa@m17n.org>
+
+       * keymap.c (push_key_description): Pay attention to
+       force_multibyte.
+
+       * regex.c (re_search_2): Fix for the case of unibyte buffer.
+
 2002-10-06  Dave Love  <fx@gnu.org>
 
        * charset.c (define_charset_internal): Rename `supprementary'.
index a7ded8775153190a5c8c689ca7d1b643b068bcf1..8cbc5f7949aa1d5aed3ce755607830048a481a25 100644 (file)
@@ -4099,13 +4099,26 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop)
              int room = (startpos >= size1
                          ? size2 + size1 - startpos
                          : size1 - startpos);
-             buf_ch = RE_STRING_CHAR (d, room);
-             if (! target_multibyte)
-               MAKE_CHAR_MULTIBYTE (buf_ch);
-             buf_ch = TRANSLATE (buf_ch);
 
-             if (! fastmap[CHAR_LEADING_CODE (buf_ch)])
-               goto advance;
+             if (multibyte)
+               {
+                 /* Case of Emacs.  */
+                 if (target_multibyte)
+                   buf_ch = RE_STRING_CHAR (d, room);
+                 else
+                   {
+                     buf_ch = *d;
+                     MAKE_CHAR_MULTIBYTE (buf_ch);
+                   }
+                 buf_ch = TRANSLATE (buf_ch);
+                 if (! fastmap[CHAR_LEADING_CODE (buf_ch)])
+                   goto advance;
+               }
+             else
+               {
+                 if (! fastmap[TRANSLATE (*d)])
+                   goto advance;
+               }
            }
        }