summaryrefslogtreecommitdiffstats
path: root/cmd-new-session.c
diff options
context:
space:
mode:
authornicm <nicm>2016-03-05 07:47:52 +0000
committernicm <nicm>2016-03-05 07:47:52 +0000
commitc38e0a4bbc722865f934db1282ca6f086874f530 (patch)
tree11bc418c7ac39765ef98861de1823af70d480d0d /cmd-new-session.c
parent1f0b317088aaeb230d69f13f43ed63b7406c6fd1 (diff)
Do not use c->cwd or s->cwd if it is NULL, found by Ben Boeckel.
Diffstat (limited to 'cmd-new-session.c')
-rw-r--r--cmd-new-session.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c
index 291107bc..357ffed1 100644
--- a/cmd-new-session.c
+++ b/cmd-new-session.c
@@ -142,7 +142,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
format_defaults(ft, c, NULL, NULL, NULL);
to_free = cwd = format_expand(ft, args_get(args, 'c'));
format_free(ft);
- } else if (c != NULL && c->session == NULL)
+ } else if (c != NULL && c->session == NULL && c->cwd != NULL)
cwd = c->cwd;
else
cwd = ".";