diff options
| author | 2018-11-22 10:36:40 +0000 | |
|---|---|---|
| committer | 2018-11-22 10:36:40 +0000 | |
| commit | ca2738ca54e90bb90b98aa1e094923e07397b78d (patch) | |
| tree | 03eea4e1858148f2ccb205e875952ea9f474a74a /usr.bin/tmux/client.c | |
| parent | Output info on SIGUSR1 as well as SIGINFO to resync with portable. (diff) | |
| download | wireguard-openbsd-ca2738ca54e90bb90b98aa1e094923e07397b78d.tar.xz wireguard-openbsd-ca2738ca54e90bb90b98aa1e094923e07397b78d.zip | |
Do not use PWD unless it actually matches the real working directory.
Diffstat (limited to 'usr.bin/tmux/client.c')
| -rw-r--r-- | usr.bin/tmux/client.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/tmux/client.c b/usr.bin/tmux/client.c index 29db814efce..e482ab28dd9 100644 --- a/usr.bin/tmux/client.c +++ b/usr.bin/tmux/client.c @@ -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 <nicholas.marriott@gmail.com> @@ -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 = ""; |
