Don't boke when figuring out working directory from configuration file.

This commit is contained in:
Nicholas Marriott 2013-10-06 21:31:55 +01:00
parent aa0a57fd56
commit 9e0d7bddc0
3 changed files with 3 additions and 3 deletions

View File

@ -115,7 +115,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
return (CMD_RETURN_ERROR);
}
cwd = fd;
} else if (c->session == NULL)
} else if (c != NULL && c->session == NULL)
cwd = c->cwd;
else if ((c0 = cmd_current_client(cmdq)) != NULL)
cwd = c0->session->cwd;

View File

@ -125,7 +125,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq)
return (CMD_RETURN_ERROR);
}
cwd = fd;
} else if (cmdq->client->session == NULL)
} else if (cmdq->client != NULL && cmdq->client->session == NULL)
cwd = cmdq->client->cwd;
else
cwd = s->cwd;

View File

@ -102,7 +102,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
return (CMD_RETURN_ERROR);
}
cwd = fd;
} else if (cmdq->client->session == NULL)
} else if (cmdq->client != NULL && cmdq->client->session == NULL)
cwd = cmdq->client->cwd;
else
cwd = s->cwd;