From a21becf7ee1cb9079b1d97da282538ad43d74352 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Thu, 11 Feb 2016 22:29:43 +0100 Subject: [PATCH] vim-patch:7.4.877 Problem: ":find" sometimes fails. (Excanoe) Solution: Compare current characters instead of previous ones. https://github.com/vim/vim/commit/4d0c7bc74ac6fad5cb599dc3ade6996e848d83b6 --- src/nvim/file_search.c | 5 +++-- src/nvim/version.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index 9ee1aa5359..3ad20991a4 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -1055,6 +1055,7 @@ static ff_visited_list_hdr_T *ff_get_visited_list(char_u *filename, ff_visited_l // '**\20' is equal to '**\24' static bool ff_wc_equal(char_u *s1, char_u *s2) { + int i, j; int c1 = NUL; int c2 = NUL; int prev1 = NUL; @@ -1068,7 +1069,7 @@ static bool ff_wc_equal(char_u *s1, char_u *s2) return false; } - for (int i = 0, j = 0; s1[i] != NUL && s2[j] != NUL;) { + for (i = 0, j = 0; s1[i] != NUL && s2[j] != NUL;) { c1 = PTR2CHAR(s1 + i); c2 = PTR2CHAR(s2 + j); @@ -1082,7 +1083,7 @@ static bool ff_wc_equal(char_u *s1, char_u *s2) i += MB_PTR2LEN(s1 + i); j += MB_PTR2LEN(s2 + j); } - return c1 == c2; + return s1[i] == s2[j]; } /* diff --git a/src/nvim/version.c b/src/nvim/version.c index e1910895b6..9a9d6dfd38 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -411,7 +411,7 @@ static int included_patches[] = { // 880 NA // 879, // 878, - // 877, + 877, // 876 NA // 875 NA // 874 NA