aboutsummaryrefslogtreecommitdiff
path: root/cmd-source-file.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2014-10-29 12:50:05 +0000
committerThomas Adam <thomas@xteddy.org>2014-10-29 12:51:21 +0000
commit35ffd093d724053046ae49984af0beb0530e5560 (patch)
treed5b89a213621dc56b852fc7eb8a1daba12046830 /cmd-source-file.c
parent201036ad80f2e51f7238db2adf05914a4a4f5819 (diff)
parent10a9440055ccdda5788965bcb048207eab2a0548 (diff)
downloadrtmux-35ffd093d724053046ae49984af0beb0530e5560.tar.gz
rtmux-35ffd093d724053046ae49984af0beb0530e5560.tar.bz2
rtmux-35ffd093d724053046ae49984af0beb0530e5560.zip
Merge branch 'obsd-master'
Conflicts: Makefile cmd-link-window.c cmd-unlink-window.c
Diffstat (limited to 'cmd-source-file.c')
-rw-r--r--cmd-source-file.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/cmd-source-file.c b/cmd-source-file.c
index 33e9cca2..0b277c25 100644
--- a/cmd-source-file.c
+++ b/cmd-source-file.c
@@ -28,7 +28,6 @@
enum cmd_retval cmd_source_file_exec(struct cmd *, struct cmd_q *);
-void cmd_source_file_show(struct cmd_q *);
void cmd_source_file_done(struct cmd_q *);
const struct cmd_entry cmd_source_file_entry = {
@@ -59,11 +58,12 @@ cmd_source_file_exec(struct cmd *self, struct cmd_q *cmdq)
free(cause);
return (CMD_RETURN_ERROR);
}
- ARRAY_ADD(&cfg_causes, cause);
+ cfg_add_cause("%s", cause);
+ free(cause);
/* FALLTHROUGH */
case 0:
if (cfg_references == 0)
- cmd_source_file_show(cmdq);
+ cfg_print_causes(cmdq);
cmdq_free(cmdq1);
return (CMD_RETURN_NORMAL);
}
@@ -76,20 +76,6 @@ cmd_source_file_exec(struct cmd *self, struct cmd_q *cmdq)
}
void
-cmd_source_file_show(struct cmd_q *cmdq)
-{
- u_int i;
- char *cause;
-
- for (i = 0; i < ARRAY_LENGTH(&cfg_causes); i++) {
- cause = ARRAY_ITEM(&cfg_causes, i);
- cmdq_print(cmdq, "%s", cause);
- free(cause);
- }
- ARRAY_FREE(&cfg_causes);
-}
-
-void
cmd_source_file_done(struct cmd_q *cmdq1)
{
struct cmd_q *cmdq = cmdq1->data;
@@ -105,6 +91,6 @@ cmd_source_file_done(struct cmd_q *cmdq1)
return;
if (cfg_references == 0)
- cmd_source_file_show(cmdq);
+ cfg_print_causes(cmdq);
cmdq_continue(cmdq);
}