summaryrefslogtreecommitdiffstats
path: root/cmd-new-session.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2010-02-08 18:29:32 +0000
committerTiago Cunha <tcunha@gmx.com>2010-02-08 18:29:32 +0000
commit36a80b2cd639fc82b8fc3d8c3672cc88ae00f1ac (patch)
tree433a4b1783d04085f0859b4fc6d7550ab7dd5913 /cmd-new-session.c
parentc6ba78137977bd7a447fd5f97b205544c2b41505 (diff)
Sync OpenBSD patchset 640:
Use the array.h code for the causes list.
Diffstat (limited to 'cmd-new-session.c')
-rw-r--r--cmd-new-session.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c
index e416a15a..2e061826 100644
--- a/cmd-new-session.c
+++ b/cmd-new-session.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-new-session.c,v 1.74 2010-02-08 18:10:07 tcunha Exp $ */
+/* $Id: cmd-new-session.c,v 1.75 2010-02-08 18:29:32 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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 */