Try to get current dir from PWD first

This commit is contained in:
Arun Prakash Jana 2021-08-10 22:34:18 +05:30
parent e146ad0d7a
commit 97ac88dec2
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -8306,7 +8306,8 @@ int main(int argc, char *argv[])
session = NULL; session = NULL;
} else if (argc == optind) { } else if (argc == optind) {
/* Start in the current directory */ /* Start in the current directory */
initpath = getcwd(NULL, 0); initpath = getenv("PWD");
initpath = initpath ? xstrdup(initpath) : getcwd(NULL, 0);
if (!initpath) if (!initpath)
initpath = "/"; initpath = "/";
} else { } else {