aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar 0xACE <0xaced@gmail.com>2019-07-12 14:33:39 +0200
committerGravatar 0xACE <0xaced@gmail.com>2019-07-12 14:44:59 +0200
commit78ada7a8bc0f2622af461f54dc80abf10abf6f1c (patch)
tree2d7f69a2039afaec8a5838e3bb019bade621694f
parente3393d04370a30ead0448c298016e960c4ae5fa2 (diff)
downloadnnn-78ada7a8bc0f2622af461f54dc80abf10abf6f1c.tar.gz
fixed misleading `else if` & text. removed lastdir
-rw-r--r--src/nnn.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 7a133ef..4bcc55b 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3297,16 +3297,10 @@ nochange:
if (getppid() == 1)
_exit(0);
- /* Check if CWD is deleted and find a existing parent */
+ /* Check if CWD is deleted and find an existing parent */
if (access(path, F_OK)) {
DPRINTF_S("dir deleted or moved");
- /* Save last working directory */
- xstrlcpy(lastdir, path, PATH_MAX);
-
- /* Save history */
- xstrlcpy(lastname, xbasename(path), NAME_MAX + 1);
-
xstrlcpy(newpath, path, PATH_MAX);
while (true) {
dir = visit_parent(path, newpath, &presel);
@@ -3314,7 +3308,8 @@ nochange:
if (!dir)
dir = dirname(newpath);
break;
- } else if (!dir) {
+ }
+ if (!dir) {
xstrlcpy(path, newpath, PATH_MAX);
continue;
}
@@ -3324,7 +3319,7 @@ nochange:
xstrlcpy(path, dir, PATH_MAX);
setdirwatch();
- mvprintw(xlines - 1, 0, "folder disappeared\n");
+ mvprintw(xlines - 1, 0, "cannot access directory\n");
xdelay();
goto begin;
}