From: Arun Prakash Jana Date: Thu, 12 Aug 2021 05:16:12 +0000 (+0530) Subject: Do not modify $PWD X-Git-Tag: v4.3~54 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=fc00faf7d0f4cd0b4637e719af52100861e8c17a;p=nnn.git Do not modify $PWD --- diff --git a/src/nnn.c b/src/nnn.c index b7654280..55557d6f 100644 --- 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 {