summaryrefslogtreecommitdiffstats
path: root/cmd-new-session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2010-02-06 23:22:27 +0000
committerNicholas Marriott <nicm@openbsd.org>2010-02-06 23:22:27 +0000
commit46511805037cf33bd9e2c6286e33417d9fd35d1f (patch)
tree1eeeeb3e2184b8dd28e011c6402532e396493ad7 /cmd-new-session.c
parentbb53c20c1882cbc909d4fe2ae3c6ad665da6abf6 (diff)
Use the array.h code for the causes list.
Diffstat (limited to 'cmd-new-session.c')
-rw-r--r--cmd-new-session.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c
index 20ef8d65..462ffc6c 100644
--- a/cmd-new-session.c
+++ b/cmd-new-session.c
@@ -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 */