summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2018-01-24 10:55:20 +0100
committerLemonBoy <thatlemon@gmail.com>2018-01-24 10:55:20 +0100
commit260733475c2b701c35024a3b4fbe900751b45341 (patch)
tree9687aeb7c957f8c53076518183002e04ddd6d499 /src/irc
parentb0b40be82e046785562fdb18dca3b1afb1b08a2b (diff)
downloadirssi-260733475c2b701c35024a3b4fbe900751b45341.zip
Accept CAPs with an empty value (KEY=)
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/core/irc-cap.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/irc/core/irc-cap.c b/src/irc/core/irc-cap.c
index 95a051f0..dd720841 100644
--- a/src/irc/core/irc-cap.c
+++ b/src/irc/core/irc-cap.c
@@ -91,19 +91,13 @@ static gboolean parse_cap_name(char *name, char **key, char **val)
if (eq == NULL) {
*key = g_strdup(name);
*val = NULL;
- return TRUE;
/* Some values are in a KEY=VALUE form, parse them */
- } else if (eq[1] != '\0') {
+ } else {
*key = g_strndup(name, (gsize)(eq - name));
*val = g_strdup(eq + 1);
- return TRUE;
- /* If the string ends after the '=' consider the value
- * as invalid */
- } else {
- *key = NULL;
- *val = NULL;
- return FALSE;
}
+
+ return TRUE;
}
static void event_cap (IRC_SERVER_REC *server, char *args, char *nick, char *address)