commit 97ac88dec2fe4cd2bde49d50817e359531c7280c
parent e146ad0d7ab752ebbcb3656171efe0649627bb1b
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date: Tue, 10 Aug 2021 22:34:18 +0530
Try to get current dir from PWD first
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/nnn.c b/src/nnn.c
@@ -8306,7 +8306,8 @@ int main(int argc, char *argv[])
session = NULL;
} else if (argc == optind) {
/* Start in the current directory */
- initpath = getcwd(NULL, 0);
+ initpath = getenv("PWD");
+ initpath = initpath ? xstrdup(initpath) : getcwd(NULL, 0);
if (!initpath)
initpath = "/";
} else {