mirror of
https://github.com/jarun/nnn.git
synced 2025-03-19 04:49:49 +00:00
Escape unreadable dirs we are already into
We care about the directory we are going to, so there is no reason to get locked inside there if the parent is readable.
This commit is contained in:
parent
0548a181e6
commit
1742598256
1 changed files with 3 additions and 2 deletions
5
noice.c
5
noice.c
|
@ -689,11 +689,12 @@ nochange:
|
||||||
strcmp(path, ".") == 0 ||
|
strcmp(path, ".") == 0 ||
|
||||||
strchr(path, '/') == NULL)
|
strchr(path, '/') == NULL)
|
||||||
goto nochange;
|
goto nochange;
|
||||||
if (canopendir(path) == 0) {
|
dir = xdirname(path);
|
||||||
|
if (canopendir(dir) == 0) {
|
||||||
|
free(dir);
|
||||||
printwarn();
|
printwarn();
|
||||||
goto nochange;
|
goto nochange;
|
||||||
}
|
}
|
||||||
dir = xdirname(path);
|
|
||||||
/* Save history */
|
/* Save history */
|
||||||
oldpath = path;
|
oldpath = path;
|
||||||
path = dir;
|
path = dir;
|
||||||
|
|
Loading…
Add table
Reference in a new issue