aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/nnn.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 4bcc55b..bb2e285 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3301,6 +3301,9 @@ nochange:
if (access(path, F_OK)) {
DPRINTF_S("dir deleted or moved");
+ /* Save history */
+ xstrlcpy(lastname, xbasename(path), NAME_MAX + 1);
+
xstrlcpy(newpath, path, PATH_MAX);
while (true) {
dir = visit_parent(path, newpath, &presel);