mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 01:46:29 +00:00
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
This commit is contained in:

committed by
Justin M. Keyes

parent
c51864b826
commit
77e416b711
@@ -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.
|
||||
|
Reference in New Issue
Block a user