aboutsummaryrefslogtreecommitdiffstats
path: root/nnn.c
diff options
context:
space:
mode:
Diffstat (limited to 'nnn.c')
-rw-r--r--nnn.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/nnn.c b/nnn.c
index dc19656..57ed6e6 100644
--- a/nnn.c
+++ b/nnn.c
@@ -952,7 +952,11 @@ main(int argc, char *argv[])
printptr = &printent;
if (argv[1] != NULL) {
- ipath = argv[1];
+ ipath = realpath(argv[1], cwd);
+ if (!ipath) {
+ fprintf(stderr, "%s: no such dir\n", argv[1]);
+ exit(1);
+ }
} else {
ipath = getcwd(cwd, sizeof(cwd));
if (ipath == NULL)