From 8a40e10d55d5ebedb079ef96aa2619ecf9b45988 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 25 Mar 2013 11:35:55 +0000 Subject: Add time and a command count to control mode guards, based on code from George Nachman. --- control.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'control.c') diff --git a/control.c b/control.c index fc2d6e43..e78186e4 100644 --- a/control.c +++ b/control.c @@ -68,8 +68,13 @@ control_callback(struct client *c, int closed, unused void *data) } if (cmd_string_parse(line, &cmdlist, NULL, 0, &cause) != 0) { - control_write(c, "%%error in line \"%s\": %s", line, - cause); + c->cmdq->time = time(NULL); + c->cmdq->number++; + + cmdq_guard(c->cmdq, "begin"); + control_write(c, "parse error: %s", cause); + cmdq_guard(c->cmdq, "error"); + free(cause); } else { cmdq_run(c->cmdq, cmdlist); -- cgit