# HG changeset patch # User Bram Moolenaar # Date 1546378208 -3600 # Node ID 417bf10a756dcdf1b2e506399ba2f21693fe6a6f # Parent 8fe428256607329a13b28eef70f7b2a8bf71e82e patch 8.1.0677: look-behind match may use the wrong line number commit https://github.com/vim/vim/commit/866f3558141aa68862aa2fedbb7747bf2365e838 Author: Bram Moolenaar Date: Tue Jan 1 22:19:08 2019 +0100 patch 8.1.0677: look-behind match may use the wrong line number Problem: Look-behind match may use the wrong line number. (Dominique Pelle) Solution: Use the line number in regsave instead of the one in behind_pos, we may be looking at the previous line. (closes #3749) diff --git a/src/regexp.c b/src/regexp.c --- a/src/regexp.c +++ b/src/regexp.c @@ -5582,7 +5582,7 @@ regmatch( if (has_mbyte) { char_u *line = - reg_getline(behind_pos.rs_u.pos.lnum); + reg_getline(rp->rs_un.regsave.rs_u.pos.lnum); rp->rs_un.regsave.rs_u.pos.col -= (*mb_head_off)(line, line diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -800,6 +800,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 677, +/**/ 676, /**/ 675,