summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.292
blob: c35c616639b8f0b76a86776a66fb62f4aa39e922 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
To: vim_dev@googlegroups.com
Subject: Patch 7.4.292
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.292
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.
Files:	    src/regexp.c, src/testdir/test95.in, src/testdir/test95.ok


*** ../vim-7.4.291/src/regexp.c	2014-05-13 16:46:25.693696760 +0200
--- src/regexp.c	2014-05-13 17:45:50.977727970 +0200
***************
*** 4692,4722 ****
  		    /* match empty string always works; happens when "~" is
  		     * empty. */
  		}
! 		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;
  #ifdef FEAT_MBYTE
  		    /* Check for following composing character. */
! 		    else if (enc_utf8
! 			       && UTF_COMPOSINGLIKE(reginput, reginput + len))
  		    {
  			/* 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;
  		    }
  #endif
! 		    else
  			reginput += len;
  		}
  	    }
--- 4692,4728 ----
  		    /* match empty string always works; happens when "~" is
  		     * empty. */
  		}
! 		else
! 		{
! 		    if (opnd[1] == NUL
  #ifdef FEAT_MBYTE
  			    && !(enc_utf8 && ireg_ic)
  #endif
  			)
! 		    {
! 			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. */
! 		    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. */
! 			status = RA_NOMATCH;
  		    }
  #endif
! 		    if (status != RA_NOMATCH)
  			reginput += len;
  		}
  	    }
*** ../vim-7.4.291/src/testdir/test95.in	2013-07-21 16:53:52.000000000 +0200
--- src/testdir/test95.in	2014-05-13 17:49:00.201729626 +0200
***************
*** 50,55 ****
--- 50,57 ----
  :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
*** ../vim-7.4.291/src/testdir/test95.ok	2013-07-21 17:01:22.000000000 +0200
--- src/testdir/test95.ok	2014-05-13 17:49:46.709730033 +0200
***************
*** 67,72 ****
--- 67,78 ----
  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
*** ../vim-7.4.291/src/version.c	2014-05-13 16:46:25.693696760 +0200
--- src/version.c	2014-05-13 18:00:22.149735596 +0200
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     292,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
154. You fondle your mouse.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///