1
0
forked from aniani/vim

updated for version 7.3.981

Problem:    In the old regexp engine \i, \I, \f and \F don't work on
            multi-byte characters.
Solution:   Dereference pointer properly.
This commit is contained in:
Bram Moolenaar
2013-05-21 00:03:02 +02:00
parent 745fc029ba
commit 09ea9fcf3f
4 changed files with 12 additions and 2 deletions

View File

@@ -5758,7 +5758,7 @@ regrepeat(p, maxcount)
case SIDENT + ADD_NL:
while (count < maxcount)
{
if (vim_isIDc(*scan) && (testval || !VIM_ISDIGIT(*scan)))
if (vim_isIDc(PTR2CHAR(scan)) && (testval || !VIM_ISDIGIT(*scan)))
{
mb_ptr_adv(scan);
}
@@ -5819,7 +5819,7 @@ regrepeat(p, maxcount)
case SFNAME + ADD_NL:
while (count < maxcount)
{
if (vim_isfilec(*scan) && (testval || !VIM_ISDIGIT(*scan)))
if (vim_isfilec(PTR2CHAR(scan)) && (testval || !VIM_ISDIGIT(*scan)))
{
mb_ptr_adv(scan);
}

View File

@@ -262,6 +262,10 @@ STARTTEST
:call add(tl, ['[a-zA-Z]', 'a', 'a'])
:call add(tl, ['[A-Z]', 'a'])
:call add(tl, ['\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa'])
:call add(tl, ['\i\+', '&*§xx ', 'xx'])
:call add(tl, ['\%#=1\i\+', '&*§xx ', 'xx'])
:call add(tl, ['\f\+', '&*Ÿfname ', 'fname'])
:call add(tl, ['\%#=1\i\+', '&*Ÿfname ', 'fname'])
:"""" Tests for \z features
:call add(tl, ['xx \ze test', 'xx ']) " must match after \ze

View File

@@ -203,6 +203,10 @@ OK - [a-z]
OK - [a-zA-Z]
OK - [A-Z]
OK - \C[^A-Z]\+
OK - \i\+
OK - \%#=1\i\+
OK - \f\+
OK - \%#=1\i\+
OK - xx \ze test
OK - abc\zeend
OK - abc\zsdd

View File

@@ -728,6 +728,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
981,
/**/
980,
/**/