Do not use c->cwd or s->cwd if it is NULL, found by Ben Boeckel.

This commit is contained in:
nicm
2016-03-05 07:47:52 +00:00
parent 1f0b317088
commit c38e0a4bbc
3 changed files with 5 additions and 5 deletions

View File

@ -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 = ".";