Skip to content
Permalink
Browse files

Properly pass tag keys w/o values

  • Loading branch information
vanosg committed Feb 14, 2020
1 parent 899b3ed commit 5ecb9a79eb21106abf95e35c61b85fc21aa372fe
Showing with 8 additions and 5 deletions.
  1. +8 −5 src/mod/server.mod/servmsg.c
@@ -1096,7 +1096,7 @@ static void server_activity(int idx, char *tagmsg, int len)
char *from, *code, *s1, *s2, *saveptr1, *saveptr2, *tagstrptr=NULL;
char *token, *subtoken, tagstr[TOTALTAGMAX], tagdict[TOTALTAGMAX], *msgptr;
char rawmsg[RECVLINEMAX+7];
int taglen, i;
int taglen, i, found;

if (trying_server) {
strcpy(dcc[idx].nick, "(server)");
@@ -1125,18 +1125,21 @@ static void server_activity(int idx, char *tagmsg, int len)
token++;
}
if (strchr(token, '=')) {
found = 0;
for (s2 = token; ; s2 = NULL) {
subtoken = strtok_r(s2, "=", &saveptr2);
if (subtoken == NULL) {
break;
}
taglen += egg_snprintf(tagdict + taglen, TOTALTAGMAX - taglen,
"%s ", subtoken);
found++;
}
/* Account for tags (not key/value pairs), prep empty value for Tcl */
if (found < 2) {
taglen += egg_snprintf(tagdict + taglen, TOTALTAGMAX - taglen,
"{} ");
}
/* Account for tags (not key/value pairs), prep empty value for Tcl */
} else {
taglen += egg_snprintf(tagdict + taglen, TOTALTAGMAX - taglen,
"%s {} ", token);
}
}
tagdict[taglen-1] = '\0'; /* Remove trailing space */

0 comments on commit 5ecb9a7

Please sign in to comment.
You can’t perform that action at this time.