From 77e416b7115fd6bf8f36176f2d0aaa3369167cff Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Sun, 30 Aug 2015 18:14:26 -0300 Subject: do_path_expand: Avoid non-readable directories. #3273 Closes https://github.com/neovim/neovim/issues/3164 Closes https://github.com/neovim/neovim/issues/3194 Closes https://github.com/neovim/neovim/issues/3221 Helped-by: @splinterofchaos Helped-by: @oni-link Helped-by: @justinmk --- src/nvim/os/fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/os') diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index 3789da3b17..522e49950c 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -421,10 +421,10 @@ bool os_scandir(Directory *dir, const char *path) FUNC_ATTR_NONNULL_ALL { int r = uv_fs_scandir(&fs_loop, &dir->request, path, 0, NULL); - if (r <= 0) { + if (r < 0) { os_closedir(dir); } - return r > 0; + return r >= 0; } /// Increments the directory pointer. -- cgit