Skip to content

Commit

Permalink
Do not modify $PWD
Browse files Browse the repository at this point in the history
  • Loading branch information
jarun committed Aug 12, 2021
1 parent 42061b0 commit fc00faf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/nnn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit fc00faf

Please sign in to comment.