commit fc00faf7d0f4cd0b4637e719af52100861e8c17a parent 42061b0399008f0ae7a2863e8a8e0e0465c41d62 Author: Arun Prakash Jana <engineerarun@gmail.com> Date: Thu, 12 Aug 2021 10:46:12 +0530 Do not modify $PWD Diffstat:
| M | src/nnn.c | | | 5 | +++-- |
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git 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 {