jcs
/wallops
/amendments
/25
irc: Copy msg to arg[0] if it's blank
Some servers like InspIRCd-3 send a JOIN like "JOIN :#channel" instead
of "JOIN #channel" (which seems to go against RFC2812, but whatever).
jcs made amendment 25 over 2 years ago
--- irc.c Thu Feb 10 10:11:26 2022
+++ irc.c Thu Feb 10 10:43:44 2022
@@ -396,6 +396,10 @@ irc_process_server(struct chatter *chatter)
while (line != NULL && line[0] != '\0') {
if (line[0] == ':') {
strlcpy(msg.msg, line + 1, sizeof(msg.msg));
+
+ /* some irc servers put the first arg as the message */
+ if (curarg == 0)
+ strlcpy(msg.arg[0], line + 1, sizeof(msg.arg[0]));
break;
}