diff --git a/src/nvim/search.c b/src/nvim/search.c index 68569b6b92..8a3a09b09e 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -3003,7 +3003,7 @@ void find_pattern_in_path(char *ptr, Direction dir, size_t len, bool whole, bool char *p_fname = (curr_fname == curbuf->b_fname) ? curbuf->b_ffname : curr_fname; - if (inc_opt != NULL && strstr(inc_opt, "\\zs") != NULL) { + if (strstr(inc_opt, "\\zs") != NULL) { // Use text from '\zs' to '\ze' (or end) of 'include'. new_fname = find_file_name_in_path(incl_regmatch.startp[0], (size_t)(incl_regmatch.endp[0] @@ -3077,8 +3077,7 @@ void find_pattern_in_path(char *ptr, Direction dir, size_t len, bool whole, bool } else { // Isolate the file name. // Include the surrounding "" or <> if present. - if (inc_opt != NULL - && strstr(inc_opt, "\\zs") != NULL) { + if (strstr(inc_opt, "\\zs") != NULL) { // pattern contains \zs, use the match p = incl_regmatch.startp[0]; i = (int)(incl_regmatch.endp[0] diff --git a/test/old/testdir/test_diffmode.vim b/test/old/testdir/test_diffmode.vim index 3e6304a252..2c9066a0c6 100644 --- a/test/old/testdir/test_diffmode.vim +++ b/test/old/testdir/test_diffmode.vim @@ -3311,7 +3311,7 @@ func Test_diff_add_prop_in_autocmd() call StopVimInTerminal(buf) endfunc -" this was causing a use-after-free by callig winframe_remove() rerursively +" this was causing a use-after-free by calling winframe_remove() recursively func Test_diffexpr_wipe_buffers() CheckRunVimInTerminal