summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2015-10-31 10:01:12 +0000
committerThomas Adam <thomas@xteddy.org>2015-10-31 10:01:12 +0000
commit17f6c3be8eeb0b67d07f916026dab918795c0317 (patch)
tree08a10a780a8de977d4452c10a7a9c03db1ae1702 /client.c
parente8bb385d6d9d8a91b5fa78e906531afc02320b80 (diff)
parent01defc9f4965bb174e1d1295754d5a8695683054 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'client.c')
-rw-r--r--client.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/client.c b/client.c
index 83aa05ca..db29fdec 100644
--- a/client.c
+++ b/client.c
@@ -272,8 +272,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)
- cwd = "/";
+ if ((cwd = getcwd(path, sizeof path)) == NULL) {
+ if ((cwd = find_home()) == NULL)
+ cwd = "/";
+ }
if ((ttynam = ttyname(STDIN_FILENO)) == NULL)
ttynam = "";