| To: vim_dev@googlegroups.com |
| Subject: Patch 7.4.253 |
| 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.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. |
| Files: src/regexp.c, src/regexp_nfa.c |
| |
| |
| |
| |
| |
| *** 4146,4152 **** |
| { |
| /* Only accept single line matches. */ |
| if (reg_startzpos[i].lnum >= 0 |
| ! && reg_endzpos[i].lnum == reg_startzpos[i].lnum) |
| re_extmatch_out->matches[i] = |
| vim_strnsave(reg_getline(reg_startzpos[i].lnum) |
| + reg_startzpos[i].col, |
| --- 4146,4153 ---- |
| { |
| /* Only accept single line matches. */ |
| if (reg_startzpos[i].lnum >= 0 |
| ! && 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, |
| |
| |
| |
| *** 6781,6788 **** |
| { |
| struct multipos *mpos = &subs.synt.list.multi[i]; |
| |
| ! /* Only accept single line matches. */ |
| ! if (mpos->start.lnum >= 0 && mpos->start.lnum == mpos->end.lnum) |
| re_extmatch_out->matches[i] = |
| vim_strnsave(reg_getline(mpos->start.lnum) |
| + mpos->start.col, |
| --- 6781,6790 ---- |
| { |
| struct multipos *mpos = &subs.synt.list.multi[i]; |
| |
| ! /* 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, |
| |
| |
| |
| *** 736,737 **** |
| --- 736,739 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 253, |
| /**/ |
| |
| -- |
| A day without sunshine is like, well, night. |
| |
| /// 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 /// |