aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/nnn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 8f5fa27..26830ed 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -5807,7 +5807,7 @@ nochange:
rundir[0] = '\0';
}
- if (newpath[0])
+ if (newpath[0] && !access(newpath, F_OK))
xstrlcpy(lastname, xbasename(newpath), NAME_MAX+1);
else if (ndents)
copycurname();