aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-04-15 19:09:28 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-04-15 19:38:07 +0530
commitbb002eeda0623e2c1abc1cb7ce8a3ebd8e5ee2a0 (patch)
tree16a0193e0c69584c28cfdfaae581c787498d2609 /src
parent6013d024eff6ca738d103582ea9d6824b85eacd2 (diff)
downloadnnn-bb002eeda0623e2c1abc1cb7ce8a3ebd8e5ee2a0.tar.gz
Fix #243
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 4b73494..c11aa23 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4024,10 +4024,8 @@ int main(int argc, char *argv[])
}
/* Confirm we are in a terminal */
- if (!cfg.picker && !(isatty(0) && isatty(1))) {
- xerror();
- return 1;
- }
+ if (!cfg.picker && !(isatty(0) && isatty(1)))
+ exit(1);
/* Get the context colors; copier used as tmp var */
copier = xgetenv(env_cfg[NNN_CONTEXT_COLORS], "4444");
@@ -4069,7 +4067,11 @@ int main(int argc, char *argv[])
if (!ipath)
ipath = "/";
} else {
- ipath = realpath(argv[optind], cwd);
+ ipath = argv[optind];
+ if (strlen(ipath) > 7 && ipath[0] == 'f' && ipath[1] == 'i' && ipath[2] == 'l'
+ && ipath[3] == 'e' && ipath[4] == ':' && ipath[5] == '/' && ipath[6] == '/')
+ ipath = ipath + 7;
+ ipath = realpath(ipath, cwd);
if (!ipath) {
xerror();
return 1;