diff options
| author | 2017-03-31 01:34:41 +0530 | |
|---|---|---|
| committer | 2017-03-31 01:34:41 +0530 | |
| commit | 86c3f75512851abc37d84a5b3db603bff1db92cb (patch) | |
| tree | 5c93415f22d099d0e16d809b40810eb87b764c19 | |
| parent | 8775a527799aa9d023abb412ae537b79c52494b3 (diff) | |
| download | nnn-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.
| -rw-r--r-- | nnn.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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) |