From 86c3f75512851abc37d84a5b3db603bff1db92cb Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Fri, 31 Mar 2017 01:34:41 +0530 Subject: 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. --- nnn.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'nnn.c') 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) -- cgit v1.2.3-70-g09d2