diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2014-04-14 17:19:27 +0200 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-04-16 09:48:50 -0300 |
commit | b94239e03c9713c784267972c8b2a90192314556 (patch) | |
tree | 88c5baa244bcda31c29d032ec761c6b932096798 /src | |
parent | cb0adf60de98003564105169dee4bc792c56a559 (diff) | |
download | rneovim-b94239e03c9713c784267972c8b2a90192314556.tar.gz rneovim-b94239e03c9713c784267972c8b2a90192314556.tar.bz2 rneovim-b94239e03c9713c784267972c8b2a90192314556.zip |
vim-patch:7.4.253
Problem: Crash when using cpp syntax file with pattern using external
match. (Havard Garnes)
Solution: Discard match when end column is before start column.
https://code.google.com/p/vim/source/detail?r=4901a36479f200b2e6700ad91c26911d92deb886
Diffstat (limited to 'src')
-rw-r--r-- | src/regexp.c | 9 | ||||
-rw-r--r-- | src/regexp_nfa.c | 12 | ||||
-rw-r--r-- | src/version.c | 3 |
3 files changed, 14 insertions, 10 deletions
diff --git a/src/regexp.c b/src/regexp.c index 289e64cf2c..9120c8b097 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -3665,11 +3665,14 @@ static long regtry(bt_regprog_T *prog, colnr_T col) if (REG_MULTI) { /* Only accept single line matches. */ if (reg_startzpos[i].lnum >= 0 - && reg_endzpos[i].lnum == reg_startzpos[i].lnum) + && reg_endzpos[i].lnum == reg_startzpos[i].lnum + && reg_endzpos[i].col >= reg_startzpos[i].col) { re_extmatch_out->matches[i] = vim_strnsave(reg_getline(reg_startzpos[i].lnum) - + reg_startzpos[i].col, - reg_endzpos[i].col - reg_startzpos[i].col); + + reg_startzpos[i].col, + reg_endzpos[i].col + - reg_startzpos[i].col); + } } else { if (reg_startzp[i] != NULL && reg_endzp[i] != NULL) re_extmatch_out->matches[i] = diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index 52f09ebbb7..4e4f5890fd 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -6121,12 +6121,14 @@ static long nfa_regtry(nfa_regprog_T *prog, colnr_T col) if (REG_MULTI) { struct multipos *mpos = &subs.synt.list.multi[i]; - /* Only accept single line matches. */ - if (mpos->start.lnum >= 0 && mpos->start.lnum == mpos->end.lnum) + // Only accept single line matches that are valid. + if (mpos->start.lnum >= 0 + && mpos->start.lnum == mpos->end.lnum + && mpos->end.col >= mpos->start.col) { re_extmatch_out->matches[i] = - vim_strnsave(reg_getline(mpos->start.lnum) - + mpos->start.col, - mpos->end.col - mpos->start.col); + vim_strnsave(reg_getline(mpos->start.lnum) + mpos->start.col, + mpos->end.col - mpos->start.col); + } } else { struct linepos *lpos = &subs.synt.list.line[i]; diff --git a/src/version.c b/src/version.c index 0f00231659..7807ca8a41 100644 --- a/src/version.c +++ b/src/version.c @@ -207,7 +207,7 @@ static int included_patches[] = { //256, //255, //254, - //253, + 253, //252, 251, //250, @@ -220,7 +220,6 @@ static int included_patches[] = { //243, //242, //241, - //240, 240, 239, //238, |