mirror of
https://github.com/weechat/weechat.git
synced 2026-07-04 00:33:13 +02:00
core: replace argument "keep_eol" by "flags" in function string_split (closes #1322)
This commit is contained in:
@@ -88,7 +88,14 @@ trigger_buffer_set_filter (const char *filter)
|
||||
}
|
||||
|
||||
if (filter && filter[0])
|
||||
trigger_buffer_filters = weechat_string_split (filter, ",", 0, 0, NULL);
|
||||
trigger_buffer_filters = weechat_string_split (
|
||||
filter,
|
||||
",",
|
||||
WEECHAT_STRING_SPLIT_STRIP_LEFT
|
||||
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
|
||||
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
|
||||
0,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -733,7 +733,14 @@ trigger_callback_modifier_cb (const void *pointer, void *data,
|
||||
pos2++;
|
||||
if (pos2[0])
|
||||
{
|
||||
tags = weechat_string_split (pos2, ",", 0, 0, &num_tags);
|
||||
tags = weechat_string_split (
|
||||
pos2,
|
||||
",",
|
||||
WEECHAT_STRING_SPLIT_STRIP_LEFT
|
||||
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
|
||||
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
|
||||
0,
|
||||
&num_tags);
|
||||
length = 1 + strlen (pos2) + 1 + 1;
|
||||
str_tags = malloc (length);
|
||||
if (str_tags)
|
||||
@@ -817,8 +824,11 @@ trigger_callback_line_cb (const void *pointer, void *data,
|
||||
|
||||
weechat_hashtable_set (pointers, "buffer", buffer);
|
||||
ptr_value = weechat_hashtable_get (line, "tags");
|
||||
tags = weechat_string_split ((ptr_value) ? ptr_value : "", ",", 0, 0,
|
||||
&num_tags);
|
||||
tags = weechat_string_split ((ptr_value) ? ptr_value : "", ",",
|
||||
WEECHAT_STRING_SPLIT_STRIP_LEFT
|
||||
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
|
||||
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
|
||||
0, &num_tags);
|
||||
|
||||
/* build string with tags and commas around: ",tag1,tag2,tag3," */
|
||||
length = 1 + strlen ((ptr_value) ? ptr_value : "") + 1 + 1;
|
||||
|
||||
@@ -682,8 +682,11 @@ trigger_command_trigger (const void *pointer, void *data,
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
items = weechat_string_split (trigger_hook_default_rc[type], ",", 0, 0,
|
||||
&num_items);
|
||||
items = weechat_string_split (trigger_hook_default_rc[type], ",",
|
||||
WEECHAT_STRING_SPLIT_STRIP_LEFT
|
||||
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
|
||||
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
|
||||
0, &num_items);
|
||||
snprintf (input, sizeof (input),
|
||||
"/trigger add name %s \"%s\" \"%s\" \"%s\" \"%s\"%s%s%s",
|
||||
trigger_hook_type_string[type],
|
||||
|
||||
@@ -138,7 +138,11 @@ trigger_completion_option_value_cb (const void *pointer, void *data,
|
||||
if (!args)
|
||||
return WEECHAT_RC_OK;
|
||||
|
||||
argv = weechat_string_split (args, " ", 0, 0, &argc);
|
||||
argv = weechat_string_split (args, " ",
|
||||
WEECHAT_STRING_SPLIT_STRIP_LEFT
|
||||
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
|
||||
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
|
||||
0, &argc);
|
||||
if (!argv)
|
||||
return WEECHAT_RC_OK;
|
||||
|
||||
@@ -273,7 +277,11 @@ trigger_completion_add_default_for_hook (struct t_gui_completion *completion,
|
||||
if (!args)
|
||||
return;
|
||||
|
||||
argv = weechat_string_split (args, " ", 0, 0, &argc);
|
||||
argv = weechat_string_split (args, " ",
|
||||
WEECHAT_STRING_SPLIT_STRIP_LEFT
|
||||
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
|
||||
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
|
||||
0, &argc);
|
||||
if (!argv)
|
||||
return;
|
||||
|
||||
@@ -284,8 +292,14 @@ trigger_completion_add_default_for_hook (struct t_gui_completion *completion,
|
||||
{
|
||||
if (default_strings[type][0] && split && split[0])
|
||||
{
|
||||
items = weechat_string_split (default_strings[type], split,
|
||||
0, 0, &num_items);
|
||||
items = weechat_string_split (
|
||||
default_strings[type],
|
||||
split,
|
||||
WEECHAT_STRING_SPLIT_STRIP_LEFT
|
||||
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
|
||||
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
|
||||
0,
|
||||
&num_items);
|
||||
if (items)
|
||||
{
|
||||
for (i = 0; i < num_items; i++)
|
||||
|
||||
@@ -273,10 +273,18 @@ trigger_hook (struct t_trigger *trigger)
|
||||
|
||||
trigger_unhook (trigger);
|
||||
|
||||
argv = weechat_string_split (weechat_config_string (trigger->options[TRIGGER_OPTION_ARGUMENTS]),
|
||||
";", -1, 0, &argc);
|
||||
argv_eol = weechat_string_split (weechat_config_string (trigger->options[TRIGGER_OPTION_ARGUMENTS]),
|
||||
";", 1, 0, NULL);
|
||||
argv = weechat_string_split (
|
||||
weechat_config_string (trigger->options[TRIGGER_OPTION_ARGUMENTS]),
|
||||
";",
|
||||
0,
|
||||
0,
|
||||
&argc);
|
||||
argv_eol = weechat_string_split (
|
||||
weechat_config_string (trigger->options[TRIGGER_OPTION_ARGUMENTS]),
|
||||
";",
|
||||
WEECHAT_STRING_SPLIT_KEEP_EOL,
|
||||
0,
|
||||
NULL);
|
||||
|
||||
switch (weechat_config_integer (trigger->options[TRIGGER_OPTION_HOOK]))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user