summaryrefslogtreecommitdiffstats
path: root/spawn.c
diff options
context:
space:
mode:
authornicm <nicm>2022-08-10 14:03:59 +0000
committernicm <nicm>2022-08-10 14:03:59 +0000
commit273577ba0a88c8a373bc8a2ded7e6a08b82114d0 (patch)
treed18b8f7847c9275a64d40a673c7426b973817478 /spawn.c
parentde5cd54124e37672adfdfe0229712e7e74acc9b0 (diff)
Fix check of home directory (&& not ||), from Markus F X J Oberhumer,
GitHub issue 3297.
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 2349f1b3..98c9ba52 100644
--- a/spawn.c
+++ b/spawn.c
@@ -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, "/");