summaryrefslogtreecommitdiffstats
path: root/cmd-load-buffer.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-load-buffer.c
parent1f0b317088aaeb230d69f13f43ed63b7406c6fd1 (diff)
Do not use c->cwd or s->cwd if it is NULL, found by Ben Boeckel.
Diffstat (limited to 'cmd-load-buffer.c')
-rw-r--r--cmd-load-buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd-load-buffer.c b/cmd-load-buffer.c
index 6fd2a767..de76b855 100644
--- a/cmd-load-buffer.c
+++ b/cmd-load-buffer.c
@@ -73,9 +73,9 @@ cmd_load_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
return (CMD_RETURN_WAIT);
}
- if (c != NULL && c->session == NULL)
+ if (c != NULL && c->session == NULL && c->cwd != NULL)
cwd = c->cwd;
- else if ((s = c->session) != NULL)
+ else if ((s = c->session) != NULL && s->cwd != NULL)
cwd = s->cwd;
else
cwd = ".";