summaryrefslogtreecommitdiffstats
path: root/spawn.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2022-08-10 18:01:11 +0100
committerThomas Adam <thomas@xteddy.org>2022-08-10 18:01:11 +0100
commit9abf5d9fe5c8818a9e8a8154035f9fb667eac2b0 (patch)
treec0f6fba4f27c75beb3c21e78936abb8901f3f0ba /spawn.c
parente15058e60fdd969c4cbfd82d81a33f31e91f0b09 (diff)
parent273577ba0a88c8a373bc8a2ded7e6a08b82114d0 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'spawn.c')
-rw-r--r--spawn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/spawn.c b/spawn.c
index 2cb2b65e..e63133fe 100644
--- a/spawn.c
+++ b/spawn.c
@@ -389,7 +389,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, "/");