Mercurial > vim
diff src/regexp_nfa.c @ 5820:4901a36479f2 v7.4.253
updated for version 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.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 06 Apr 2014 21:34:04 +0200 |
parents | 50dbef5e774a |
children | 0ea551fa607d |
line wrap: on
line diff
--- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -6781,8 +6781,10 @@ nfa_regtry(prog, col) { 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,