]> Sergey Matveev's repositories - nnn.git/commitdiff
Do not modify $PWD
authorArun Prakash Jana <engineerarun@gmail.com>
Thu, 12 Aug 2021 05:16:12 +0000 (10:46 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Thu, 12 Aug 2021 05:16:12 +0000 (10:46 +0530)
src/nnn.c

index b7654280798ca9cf4fb4193e37b82339abc6123b..55557d6f2f11270fc002b80b854c676a328e86b8 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -8315,8 +8315,9 @@ int main(int argc, char *argv[])
                                session = NULL;
                } else if (argc == optind) {
                        /* Start in the current directory */
-                       initpath = getenv("PWD");
-                       initpath = initpath ? xstrdup(initpath) : getcwd(NULL, 0);
+                       char *startpath = getenv("PWD");
+
+                       initpath = startpath ? xstrdup(startpath) : getcwd(NULL, 0);
                        if (!initpath)
                                initpath = "/";
                } else {