aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-03-14 21:44:48 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2020-03-14 21:44:48 +0530
commit67994ff4b2bb1a77ba987cf4ac0793ef13190c3a (patch)
treeec7a3ff2445b1ad60c3140619b2386d01619aa00 /src
parent4e58ad318c61a2efe308de61213cd1f8e2ff32ab (diff)
downloadnnn-67994ff4b2bb1a77ba987cf4ac0793ef13190c3a.tar.gz
Check if file is accessible
Diffstat (limited to 'src')
-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();