summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-source-file.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2014-10-27 22:23:47 +0000
committernicm <nicm@openbsd.org>2014-10-27 22:23:47 +0000
commitffa87c314586d5d692cdb8e11f482cbe6bd50a99 (patch)
tree608e1c8cbb7bfc84a3aa3ef6d15089b5dd00a796 /usr.bin/tmux/cmd-source-file.c
parentRemove the spilling code for IBAT register and set up the first IBAT register (diff)
downloadwireguard-openbsd-ffa87c314586d5d692cdb8e11f482cbe6bd50a99.tar.xz
wireguard-openbsd-ffa87c314586d5d692cdb8e11f482cbe6bd50a99.zip
Move cfg_causes local into cfg.c and remove struct causelist.
Diffstat (limited to 'usr.bin/tmux/cmd-source-file.c')
-rw-r--r--usr.bin/tmux/cmd-source-file.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/usr.bin/tmux/cmd-source-file.c b/usr.bin/tmux/cmd-source-file.c
index e36f63545e6..121539836c9 100644
--- a/usr.bin/tmux/cmd-source-file.c
+++ b/usr.bin/tmux/cmd-source-file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-source-file.c,v 1.20 2014/10/20 22:29:25 nicm Exp $ */
+/* $OpenBSD: cmd-source-file.c,v 1.21 2014/10/27 22:23:47 nicm Exp $ */
/*
* Copyright (c) 2008 Tiago Cunha <me@tiagocunha.org>
@@ -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);
}