]> Sergey Matveev's repositories - nnn.git/commitdiff
Try to get current dir from PWD first
authorArun Prakash Jana <engineerarun@gmail.com>
Tue, 10 Aug 2021 17:04:18 +0000 (22:34 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Tue, 10 Aug 2021 17:04:18 +0000 (22:34 +0530)
src/nnn.c

index 8b64f78bc971e226052ed7a1eaf467facf6c1bfa..e4f9c703a7eb4143107476a8a5ba99e0a4ccae75 100644 (file)
--- 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 {