aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar lostd <lostd@2f30.org>2015-07-02 01:07:09 +0100
committerGravatar lostd <lostd@2f30.org>2015-07-02 01:07:09 +0100
commit1742598256abf086385b4fb4a2cf2a81fc6aff05 (patch)
tree0819681fcc0e9a9beba2f50bec3c02645386541b
parent0548a181e64bd9e5af6cc72282620356890b7bed (diff)
downloadnnn-1742598256abf086385b4fb4a2cf2a81fc6aff05.tar.gz
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.
-rw-r--r--noice.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/noice.c b/noice.c
index ac965bd..8fe0943 100644
--- a/noice.c
+++ b/noice.c
@@ -689,11 +689,12 @@ nochange:
strcmp(path, ".") == 0 ||
strchr(path, '/') == NULL)
goto nochange;
- if (canopendir(path) == 0) {
+ dir = xdirname(path);
+ if (canopendir(dir) == 0) {
+ free(dir);
printwarn();
goto nochange;
}
- dir = xdirname(path);
/* Save history */
oldpath = path;
path = dir;