summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-message.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2019-03-10 13:16:59 +0100
committerSébastien Helleu <flashcode@flashtux.org>2019-03-10 18:29:16 +0100
commit2b70d71aa1c891f2f251aa775cf239e5611576d5 (patch)
tree33b7daaa910582482c420e4e1e06a2d8851572e9 /src/plugins/irc/irc-message.c
parent8aa5f5375e2a16d538fdf96babcd52a2f8f7801c (diff)
downloadweechat-2b70d71aa1c891f2f251aa775cf239e5611576d5.zip
core: replace argument "keep_eol" by "flags" in function string_split (closes #1322)
Diffstat (limited to 'src/plugins/irc/irc-message.c')
-rw-r--r--src/plugins/irc/irc-message.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/plugins/irc/irc-message.c b/src/plugins/irc/irc-message.c
index 64034a3f6..45d6052ab 100644
--- a/src/plugins/irc/irc-message.c
+++ b/src/plugins/irc/irc-message.c
@@ -779,18 +779,30 @@ irc_message_split_join (struct t_hashtable *hashtable,
str = weechat_strndup (arguments, pos - arguments);
if (!str)
return 0;
- channels = weechat_string_split (str, ",", 0, 0, &channels_count);
+ channels = weechat_string_split (str, ",",
+ WEECHAT_STRING_SPLIT_STRIP_LEFT
+ | WEECHAT_STRING_SPLIT_STRIP_RIGHT
+ | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
+ 0, &channels_count);
free (str);
while (pos[0] == ' ')
{
pos++;
}
if (pos[0])
- keys = weechat_string_split (pos, ",", 0, 0, &keys_count);
+ keys = weechat_string_split (pos, ",",
+ WEECHAT_STRING_SPLIT_STRIP_LEFT
+ | WEECHAT_STRING_SPLIT_STRIP_RIGHT
+ | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
+ 0, &keys_count);
}
else
{
- channels = weechat_string_split (arguments, ",", 0, 0, &channels_count);
+ channels = weechat_string_split (arguments, ",",
+ WEECHAT_STRING_SPLIT_STRIP_LEFT
+ | WEECHAT_STRING_SPLIT_STRIP_RIGHT
+ | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
+ 0, &channels_count);
}
snprintf (msg_to_send, sizeof (msg_to_send), "%s%sJOIN",
@@ -1042,8 +1054,16 @@ irc_message_split (struct t_irc_server *server, const char *message)
}
}
- argv = weechat_string_split (message, " ", 0, 0, &argc);
- argv_eol = weechat_string_split (message, " ", 2, 0, NULL);
+ argv = weechat_string_split (message, " ",
+ WEECHAT_STRING_SPLIT_STRIP_LEFT
+ | WEECHAT_STRING_SPLIT_STRIP_RIGHT
+ | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
+ 0, &argc);
+ argv_eol = weechat_string_split (message, " ",
+ WEECHAT_STRING_SPLIT_STRIP_LEFT
+ | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS
+ | WEECHAT_STRING_SPLIT_KEEP_EOL,
+ 0, NULL);
if (argc < 2)
goto end;