=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/client.c,v retrieving revision 1.127 retrieving revision 1.128 diff -u -r1.127 -r1.128 --- src/usr.bin/tmux/client.c 2018/04/26 12:42:51 1.127 +++ src/usr.bin/tmux/client.c 2018/11/22 10:36:40 1.128 @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.127 2018/04/26 12:42:51 guenther Exp $ */ +/* $OpenBSD: client.c,v 1.128 2018/11/22 10:36:40 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -222,7 +222,7 @@ 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_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 = "";