]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.292 v7.4.292
authorBram Moolenaar <Bram@vim.org>
Tue, 13 May 2014 16:04:00 +0000 (18:04 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 13 May 2014 16:04:00 +0000 (18:04 +0200)
Problem:    Searching for "a" does not match accented "a" with new regexp
            engine, does match with old engine. (David Bürgin)
            "ca" does not match "ca" with accented "a" with either engine.
Solution:   Change the old engine, check for following composing character
            also for single-byte patterns.

src/regexp.c
src/testdir/test95.in
src/testdir/test95.ok
src/version.c

index fe837721eba3142ea477608acd6fdeaf728a5d15..d66cd2062ffa062149c423745aa910e5ddddc36b 100644 (file)
@@ -4692,31 +4692,37 @@ regmatch(scan)
                    /* match empty string always works; happens when "~" is
                     * empty. */
                }
-               else if (opnd[1] == NUL
+               else
+               {
+                   if (opnd[1] == NUL
 #ifdef FEAT_MBYTE
                            && !(enc_utf8 && ireg_ic)
 #endif
                        )
-                   ++reginput;         /* matched a single char */
-               else
-               {
-                   len = (int)STRLEN(opnd);
-                   /* Need to match first byte again for multi-byte. */
-                   if (cstrncmp(opnd, reginput, &len) != 0)
-                       status = RA_NOMATCH;
+                   {
+                       len = 1;        /* matched a single byte above */
+                   }
+                   else
+                   {
+                       /* Need to match first byte again for multi-byte. */
+                       len = (int)STRLEN(opnd);
+                       if (cstrncmp(opnd, reginput, &len) != 0)
+                           status = RA_NOMATCH;
+                   }
 #ifdef FEAT_MBYTE
                    /* Check for following composing character. */
-                   else if (enc_utf8
-                              && UTF_COMPOSINGLIKE(reginput, reginput + len))
+                   if (status != RA_NOMATCH
+                           && enc_utf8
+                           && UTF_COMPOSINGLIKE(reginput, reginput + len)
+                           && !ireg_icombine)
                    {
                        /* raaron: This code makes a composing character get
                         * ignored, which is the correct behavior (sometimes)
                         * for voweled Hebrew texts. */
-                       if (!ireg_icombine)
-                           status = RA_NOMATCH;
+                       status = RA_NOMATCH;
                    }
 #endif
-                   else
+                   if (status != RA_NOMATCH)
                        reginput += len;
                }
            }
index 90fa69945ac3572c3324fc2b67adaae08dc52ef1..817e1f12e1de646285f17d6edf8f2feae3028858 100644 (file)
@@ -50,6 +50,8 @@ STARTTEST
 :call add(tl, [2, ".\u05b9", " y\u05bb\u05b9 x\u05b9 ", "y\u05bb\u05b9"])
 :call add(tl, [1, "\u05b9\u05bb", " y\u05b9 x\u05b9\u05bb ", "x\u05b9\u05bb"])
 :call add(tl, [2, ".\u05b9\u05bb", " y\u05bb x\u05b9\u05bb ", "x\u05b9\u05bb"])
+:call add(tl, [2, "a", "ca\u0300t"])
+:call add(tl, [2, "a\u0300", "ca\u0300t", "a\u0300"])
 
 
 :"""" Test \Z
index c378221a707865487a6ee0f83b3950728d03fdf4..e2baee8d29b2ee761ea2eef53c337b8675b64e41 100644 (file)
@@ -67,6 +67,12 @@ OK 2 - ֹֻ
 OK 0 - .ֹֻ
 OK 1 - .ֹֻ
 OK 2 - .ֹֻ
+OK 0 - a
+OK 1 - a
+OK 2 - a
+OK 0 - à
+OK 1 - à
+OK 2 - à
 OK 0 - ú\Z
 OK 1 - ú\Z
 OK 2 - ú\Z
index 030e6f21a271401a42898ef17a52e68770aa2bca..5efd62d2a2a09e73ec69f042efba9cbb589dd110 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    292,
 /**/
     291,
 /**/