src/nnn.c | 5 +++-- diff --git a/src/nnn.c b/src/nnn.c index b7654280798ca9cf4fb4193e37b82339abc6123b..55557d6f2f11270fc002b80b854c676a328e86b8 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -8315,8 +8315,9 @@ if (session) 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 {