summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2018-11-22 12:02:38 +0000
committerThomas Adam <thomas@xteddy.org>2018-11-22 12:02:38 +0000
commit2977317243eac07f819190a38f74da24bfa1b741 (patch)
tree35dcb4be286ac4e0ecafd78a2ae1127ef8ca1c8f /client.c
parent2eca63b98e21a4e76d77dedf339da42f7291cc76 (diff)
parent3a7b9d57355c4b2b521f05049a5c6f5eb2939b5d (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'client.c')
-rw-r--r--client.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/client.c b/client.c
index 2ea88f7b..bb9fedf2 100644
--- a/client.c
+++ b/client.c
@@ -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 = "";