Use the array.h code for the causes list.

This commit is contained in:
Nicholas Marriott
2010-02-06 23:22:27 +00:00
parent bb53c20c18
commit 4651180503
6 changed files with 46 additions and 47 deletions

View File

@ -285,15 +285,15 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
* If there are still configuration file errors to display, put the new
* session's current window into more mode and display them now.
*/
if (cfg_finished && cfg_ncauses != 0) {
if (cfg_finished && !ARRAY_EMPTY(&cfg_causes)) {
wp = s->curw->window->active;
window_pane_set_mode(wp, &window_more_mode);
for (i = 0; i < cfg_ncauses; i++) {
window_more_add(wp, "%s", cfg_causes[i]);
xfree(cfg_causes[i]);
for (i = 0; i < ARRAY_LENGTH(&cfg_causes); i++) {
cause = ARRAY_ITEM(&cfg_causes, i);
window_more_add(wp, "%s", cause);
xfree(cause);
}
xfree(cfg_causes);
cfg_ncauses = 0;
ARRAY_FREE(&cfg_causes);
}
return (!detached); /* 1 means don't tell command client to exit */