diff options
author | nicm <nicm> | 2018-01-01 11:19:08 +0000 |
---|---|---|
committer | nicm <nicm> | 2018-01-01 11:19:08 +0000 |
commit | d17c90583a2cbbb15ec1a357380b0985e6472a5f (patch) | |
tree | 5e0fce407aba9d94b72c88a6b5e05b44b7311baf /client.c | |
parent | fe26f977e6fe81c1bedf251cc1da6cf3792a9f97 (diff) | |
download | rtmux-d17c90583a2cbbb15ec1a357380b0985e6472a5f.tar.gz rtmux-d17c90583a2cbbb15ec1a357380b0985e6472a5f.tar.bz2 rtmux-d17c90583a2cbbb15ec1a357380b0985e6472a5f.zip |
Prefer PWD for current directory if present in client, from Wei Zhao in
GitHub issue 1183.
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -279,10 +279,10 @@ client_main(struct event_base *base, int argc, char **argv, int flags) client_peer = proc_add_peer(client_proc, fd, client_dispatch, NULL); /* Save these before pledge(). */ - if ((cwd = getcwd(path, sizeof path)) == NULL) { - if ((cwd = find_home()) == NULL) - cwd = "/"; - } + if ((cwd = getenv("PWD")) == NULL && + (cwd = getcwd(path, sizeof path)) == NULL && + (cwd = find_home()) == NULL) + cwd = "/"; if ((ttynam = ttyname(STDIN_FILENO)) == NULL) ttynam = ""; |