From 917085d6530703f9baea154f5e8f0eda9c995e95 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 10 Aug 2022 14:03:59 +0000 Subject: [PATCH] Fix check of home directory (&& not ||), from Markus F X J Oberhumer, GitHub issue 3297. --- usr.bin/tmux/spawn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/tmux/spawn.c b/usr.bin/tmux/spawn.c index 1d8c96b706a..3e67eaee705 100644 --- a/usr.bin/tmux/spawn.c +++ b/usr.bin/tmux/spawn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spawn.c,v 1.30 2022/05/30 13:06:41 nicm Exp $ */ +/* $OpenBSD: spawn.c,v 1.31 2022/08/10 14:03:59 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott @@ -391,7 +391,7 @@ spawn_pane(struct spawn_context *sc, char **cause) */ if (chdir(new_wp->cwd) == 0) environ_set(child, "PWD", 0, "%s", new_wp->cwd); - else if ((tmp = find_home()) != NULL || chdir(tmp) == 0) + else if ((tmp = find_home()) != NULL && chdir(tmp) == 0) environ_set(child, "PWD", 0, "%s", tmp); else if (chdir("/") == 0) environ_set(child, "PWD", 0, "/"); -- 2.20.1