073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.292
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.292
073263
Problem:    Searching for "a" does not match accented "a" with new regexp
073263
	    engine, does match with old engine. (David Bürgin)
073263
	    "ca" does not match "ca" with accented "a" with either engine.
073263
Solution:   Change the old engine, check for following composing character
073263
	    also for single-byte patterns.
073263
Files:	    src/regexp.c, src/testdir/test95.in, src/testdir/test95.ok
073263
073263
073263
*** ../vim-7.4.291/src/regexp.c	2014-05-13 16:46:25.693696760 +0200
073263
--- src/regexp.c	2014-05-13 17:45:50.977727970 +0200
073263
***************
073263
*** 4692,4722 ****
073263
  		    /* match empty string always works; happens when "~" is
073263
  		     * empty. */
073263
  		}
073263
! 		else if (opnd[1] == NUL
073263
  #ifdef FEAT_MBYTE
073263
  			    && !(enc_utf8 && ireg_ic)
073263
  #endif
073263
  			)
073263
! 		    ++reginput;		/* matched a single char */
073263
! 		else
073263
! 		{
073263
! 		    len = (int)STRLEN(opnd);
073263
! 		    /* Need to match first byte again for multi-byte. */
073263
! 		    if (cstrncmp(opnd, reginput, &len) != 0)
073263
! 			status = RA_NOMATCH;
073263
  #ifdef FEAT_MBYTE
073263
  		    /* Check for following composing character. */
073263
! 		    else if (enc_utf8
073263
! 			       && UTF_COMPOSINGLIKE(reginput, reginput + len))
073263
  		    {
073263
  			/* raaron: This code makes a composing character get
073263
  			 * ignored, which is the correct behavior (sometimes)
073263
  			 * for voweled Hebrew texts. */
073263
! 			if (!ireg_icombine)
073263
! 			    status = RA_NOMATCH;
073263
  		    }
073263
  #endif
073263
! 		    else
073263
  			reginput += len;
073263
  		}
073263
  	    }
073263
--- 4692,4728 ----
073263
  		    /* match empty string always works; happens when "~" is
073263
  		     * empty. */
073263
  		}
073263
! 		else
073263
! 		{
073263
! 		    if (opnd[1] == NUL
073263
  #ifdef FEAT_MBYTE
073263
  			    && !(enc_utf8 && ireg_ic)
073263
  #endif
073263
  			)
073263
! 		    {
073263
! 			len = 1;	/* matched a single byte above */
073263
! 		    }
073263
! 		    else
073263
! 		    {
073263
! 			/* Need to match first byte again for multi-byte. */
073263
! 			len = (int)STRLEN(opnd);
073263
! 			if (cstrncmp(opnd, reginput, &len) != 0)
073263
! 			    status = RA_NOMATCH;
073263
! 		    }
073263
  #ifdef FEAT_MBYTE
073263
  		    /* Check for following composing character. */
073263
! 		    if (status != RA_NOMATCH
073263
! 			    && enc_utf8
073263
! 			    && UTF_COMPOSINGLIKE(reginput, reginput + len)
073263
! 			    && !ireg_icombine)
073263
  		    {
073263
  			/* raaron: This code makes a composing character get
073263
  			 * ignored, which is the correct behavior (sometimes)
073263
  			 * for voweled Hebrew texts. */
073263
! 			status = RA_NOMATCH;
073263
  		    }
073263
  #endif
073263
! 		    if (status != RA_NOMATCH)
073263
  			reginput += len;
073263
  		}
073263
  	    }
073263
*** ../vim-7.4.291/src/testdir/test95.in	2013-07-21 16:53:52.000000000 +0200
073263
--- src/testdir/test95.in	2014-05-13 17:49:00.201729626 +0200
073263
***************
073263
*** 50,55 ****
073263
--- 50,57 ----
073263
  :call add(tl, [2, ".\u05b9", " y\u05bb\u05b9 x\u05b9 ", "y\u05bb\u05b9"])
073263
  :call add(tl, [1, "\u05b9\u05bb", " y\u05b9 x\u05b9\u05bb ", "x\u05b9\u05bb"])
073263
  :call add(tl, [2, ".\u05b9\u05bb", " y\u05bb x\u05b9\u05bb ", "x\u05b9\u05bb"])
073263
+ :call add(tl, [2, "a", "ca\u0300t"])
073263
+ :call add(tl, [2, "a\u0300", "ca\u0300t", "a\u0300"])
073263
  
073263
  
073263
  :"""" Test \Z
073263
*** ../vim-7.4.291/src/testdir/test95.ok	2013-07-21 17:01:22.000000000 +0200
073263
--- src/testdir/test95.ok	2014-05-13 17:49:46.709730033 +0200
073263
***************
073263
*** 67,72 ****
073263
--- 67,78 ----
073263
  OK 0 - .ֹֻ
073263
  OK 1 - .ֹֻ
073263
  OK 2 - .ֹֻ
073263
+ OK 0 - a
073263
+ OK 1 - a
073263
+ OK 2 - a
073263
+ OK 0 - à
073263
+ OK 1 - à
073263
+ OK 2 - à
073263
  OK 0 - ú\Z
073263
  OK 1 - ú\Z
073263
  OK 2 - ú\Z
073263
*** ../vim-7.4.291/src/version.c	2014-05-13 16:46:25.693696760 +0200
073263
--- src/version.c	2014-05-13 18:00:22.149735596 +0200
073263
***************
073263
*** 736,737 ****
073263
--- 736,739 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     292,
073263
  /**/
073263
073263
-- 
073263
hundred-and-one symptoms of being an internet addict:
073263
154. You fondle your mouse.
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///