From fb74a463930412e5acbe65ccc617fcfc528af03c Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Fri, 15 Aug 2014 20:11:06 +0200
Subject: ZyklonB: `status' -> use semicolons in output
---
zyklonb.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/zyklonb.c b/zyklonb.c
index 47533f0..fde8a02 100644
--- a/zyklonb.c
+++ b/zyklonb.c
@@ -1229,21 +1229,24 @@ process_privmsg (struct bot_context *ctx, const struct irc_message *msg)
const char *reason = getenv (g_startup_reason_str);
if (!reason)
reason = "launched normally";
- str_append_printf (&report, "\x02startup reason:\x0f %s, ", reason);
-
- str_append (&report, "\x02plugins:\x0f ");
+ str_append_printf (&report,
+ "\x02startup reason:\x0f %s; \x02plugins:\x0f ", reason);
size_t zombies = 0;
+ const char *prepend = "";
for (struct plugin_data *plugin = ctx->plugins;
plugin; plugin = plugin->next)
{
if (plugin->is_zombie)
zombies++;
else
- str_append_printf (&report, "%s, ", plugin->name);
+ {
+ str_append_printf (&report, "%s%s", prepend, plugin->name);
+ prepend = ", ";
+ }
}
if (!ctx->plugins)
- str_append (&report, "\x02none\x0f, ");
- str_append_printf (&report, "\x02zombies:\x0f %zu", zombies);
+ str_append (&report, "\x02none\x0f");
+ str_append_printf (&report, "; \x02zombies:\x0f %zu", zombies);
respond_to_user (ctx, msg, "%s", report.str);
str_free (&report);
--
cgit v1.2.3-70-g09d2