From: Arun Prakash Jana Date: Tue, 10 Aug 2021 17:04:18 +0000 (+0530) Subject: Try to get current dir from PWD first X-Git-Tag: v4.3~58 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=97ac88dec2fe4cd2bde49d50817e359531c7280c;p=nnn.git Try to get current dir from PWD first --- diff --git a/src/nnn.c b/src/nnn.c index 8b64f78b..e4f9c703 100644 --- 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 {