diff options
author | nicm <nicm> | 2018-11-22 10:36:40 +0000 |
---|---|---|
committer | nicm <nicm> | 2018-11-22 10:36:40 +0000 |
commit | 3a7b9d57355c4b2b521f05049a5c6f5eb2939b5d (patch) | |
tree | e8745b18e9ba6095e272c954deb83f244e87a6f8 /client.c | |
parent | 749f67b7d801eed03345fef9c04206fbd079c3cb (diff) | |
download | rtmux-3a7b9d57355c4b2b521f05049a5c6f5eb2939b5d.tar.gz rtmux-3a7b9d57355c4b2b521f05049a5c6f5eb2939b5d.tar.bz2 rtmux-3a7b9d57355c4b2b521f05049a5c6f5eb2939b5d.zip |
Do not use PWD unless it actually matches the real working directory.
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -222,7 +222,7 @@ client_main(struct event_base *base, int argc, char **argv, int flags) const char *ttynam, *cwd; pid_t ppid; enum msgtype msg; - char *cause, path[PATH_MAX]; + char *cause; struct termios tio, saved_tio; size_t size; @@ -277,9 +277,7 @@ 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 = getenv("PWD")) == NULL && - (cwd = getcwd(path, sizeof path)) == NULL && - (cwd = find_home()) == NULL) + if ((cwd = find_cwd()) == NULL && (cwd = find_home()) == NULL) cwd = "/"; if ((ttynam = ttyname(STDIN_FILENO)) == NULL) ttynam = ""; |