mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 23:38:17 +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
@@ -612,8 +612,8 @@ static size_t do_path_expand(garray_T *gap, const char_u *path,
|
||||
*s = NUL;
|
||||
|
||||
Directory dir;
|
||||
if (os_scandir(&dir, *buf == NUL ? "." : (char *)buf)
|
||||
|| os_isdir(*buf == NUL ? (char_u *)"." : (char_u *)buf)) {
|
||||
char *dirpath = (*buf == NUL ? "." : (char *)buf);
|
||||
if (os_file_is_readable(dirpath) && os_scandir(&dir, dirpath)) {
|
||||
// Find all matching entries.
|
||||
char_u *name;
|
||||
scandir_next_with_dots(NULL /* initialize */);
|
||||
|
Reference in New Issue
Block a user