]> Sergey Matveev's repositories - nnn.git/commitdiff
fixed misleading `else if` & text. removed lastdir
author0xACE <0xaced@gmail.com>
Fri, 12 Jul 2019 12:33:39 +0000 (14:33 +0200)
committer0xACE <0xaced@gmail.com>
Fri, 12 Jul 2019 12:44:59 +0000 (14:44 +0200)
src/nnn.c

index 7a133ef09624f4bc463987a93f23e575c334ab4f..4bcc55bdd3f6b8dc2f71f2bd636f5690c7e69503 100644 (file)
--- 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;
                }