aboutsummaryrefslogtreecommitdiffstats
path: root/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-03-31 01:34:41 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-03-31 01:34:41 +0530
commit86c3f75512851abc37d84a5b3db603bff1db92cb (patch)
tree5c93415f22d099d0e16d809b40810eb87b764c19 /nnn.c
parent8775a527799aa9d023abb412ae537b79c52494b3 (diff)
downloadnnn-86c3f75512851abc37d84a5b3db603bff1db92cb.tar.gz
Fix: can't go to parent if only dir name specified
Invoking nnn with: nnn dir nnn ./dir nnn dir wouldn't allow user to navigate to parent directory.
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)