diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-01-18 10:05:31 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-01-18 10:05:31 +0800 |
commit | dda1c8edda86a50d802f777e5ba2379f7ccd6ae8 (patch) | |
tree | 890677952d1aa752db52aabf07e27d0f6b03b1b8 | |
parent | ec39e1e421101d2573ca5f9003238adfcd45dcd1 (diff) | |
download | rneovim-dda1c8edda86a50d802f777e5ba2379f7ccd6ae8.tar.gz rneovim-dda1c8edda86a50d802f777e5ba2379f7ccd6ae8.tar.bz2 rneovim-dda1c8edda86a50d802f777e5ba2379f7ccd6ae8.zip |
vim-patch:8.2.3613: :find test fails
Problem: :find test fails.
Solution: Put length check inside if block.
https://github.com/vim/vim/commit/e015d99abb4276f47ce97bad1ad5ff0c658b1c8a
-rw-r--r-- | src/nvim/file_search.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index df48370ce1..b4becb3066 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -1433,11 +1433,11 @@ char_u *find_file_in_path_option(char_u *ptr, size_t len, int options, int first rel_fname = NULL; } - if (len == 0) { - return NULL; - } + if (first == true) { + if (len == 0) { + return NULL; + } - if (first == TRUE) { // copy file name into NameBuff, expanding environment variables save_char = ptr[len]; ptr[len] = NUL; |