]> granicus.if.org Git - vim/commitdiff
patch 8.1.0677: look-behind match may use the wrong line number v8.1.0677
authorBram Moolenaar <Bram@vim.org>
Tue, 1 Jan 2019 21:19:08 +0000 (22:19 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 1 Jan 2019 21:19:08 +0000 (22:19 +0100)
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)

src/regexp.c
src/version.c

index e055dd3623f4d6a7b7bb77f69c19f0a65f464200..b7616416c9d323b9e1c49e63976e71c231d66116 100644 (file)
@@ -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
index 53dda7f1d31ac86b1cdfa044de4347ed6906d835..439e1bc3622f12a92ff9d37bcbf0a43667a6f9ba 100644 (file)
@@ -799,6 +799,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    677,
 /**/
     676,
 /**/