summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-queue.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-queue.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-queue.c')
-rw-r--r--usr.bin/tmux/cmd-queue.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/tmux/cmd-queue.c b/usr.bin/tmux/cmd-queue.c
index 5c331e6c678..f9e7a076e69 100644
--- a/usr.bin/tmux/cmd-queue.c
+++ b/usr.bin/tmux/cmd-queue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-queue.c,v 1.19 2014/10/21 22:06:46 nicm Exp $ */
+/* $OpenBSD: cmd-queue.c,v 1.20 2014/10/27 22:23:47 nicm Exp $ */
/*
* Copyright (c) 2013 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -93,17 +93,16 @@ cmdq_error(struct cmd_q *cmdq, const char *fmt, ...)
struct client *c = cmdq->client;
struct cmd *cmd = cmdq->cmd;
va_list ap;
- char *msg, *cause;
+ char *msg;
size_t msglen;
va_start(ap, fmt);
msglen = xvasprintf(&msg, fmt, ap);
va_end(ap);
- if (c == NULL) {
- xasprintf(&cause, "%s:%u: %s", cmd->file, cmd->line, msg);
- ARRAY_ADD(&cfg_causes, cause);
- } else if (c->session == NULL || (c->flags & CLIENT_CONTROL)) {
+ if (c == NULL)
+ cfg_add_cause("%s:%u: %s", cmd->file, cmd->line, msg);
+ else if (c->session == NULL || (c->flags & CLIENT_CONTROL)) {
evbuffer_add(c->stderr_data, msg, msglen);
evbuffer_add(c->stderr_data, "\n", 1);