Skip to content

Commit f7d2f62

Browse files
committed
updated for version 7.4.360
Problem: In a regexp pattern a "$" followed by \v or \V is not seen as the end-of-line. Solution: Handle the situation. (Ozaki Kiichi)
1 parent 395a22f commit f7d2f62

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/regexp.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3109,15 +3109,25 @@ peekchr()
31093109
if (reg_magic >= MAGIC_OFF)
31103110
{
31113111
char_u *p = regparse + 1;
3112+
int is_magic_all = (reg_magic == MAGIC_ALL);
31123113

3113-
/* ignore \c \C \m and \M after '$' */
3114+
/* ignore \c \C \m \M \v \V and \Z after '$' */
31143115
while (p[0] == '\\' && (p[1] == 'c' || p[1] == 'C'
3115-
|| p[1] == 'm' || p[1] == 'M' || p[1] == 'Z'))
3116+
|| p[1] == 'm' || p[1] == 'M'
3117+
|| p[1] == 'v' || p[1] == 'V' || p[1] == 'Z'))
3118+
{
3119+
if (p[1] == 'v')
3120+
is_magic_all = TRUE;
3121+
else if (p[1] == 'm' || p[1] == 'M' || p[1] == 'V')
3122+
is_magic_all = FALSE;
31163123
p += 2;
3124+
}
31173125
if (p[0] == NUL
31183126
|| (p[0] == '\\'
31193127
&& (p[1] == '|' || p[1] == '&' || p[1] == ')'
31203128
|| p[1] == 'n'))
3129+
|| (is_magic_all
3130+
&& (p[0] == '|' || p[0] == '&' || p[0] == ')'))
31213131
|| reg_magic == MAGIC_ALL)
31223132
curchr = Magic('$');
31233133
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
360,
737739
/**/
738740
359,
739741
/**/

0 commit comments

Comments
 (0)