1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 16:53:14 +02:00

api: add argument "strip_items" in function string_split

This commit is contained in:
Sébastien Helleu
2019-06-15 20:47:14 +02:00
parent 866a29c7e6
commit 9178156354
78 changed files with 473 additions and 195 deletions
+5 -3
View File
@@ -832,7 +832,7 @@ script_action_show_diff_process_cb (const void *pointer, void *data,
{
if (out)
{
lines = weechat_string_split (out, "\n",
lines = weechat_string_split (out, "\n", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
@@ -871,7 +871,7 @@ script_action_show_diff_process_cb (const void *pointer, void *data,
}
else if (err)
{
lines = weechat_string_split (err, "\n",
lines = weechat_string_split (err, "\n", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
@@ -1181,7 +1181,7 @@ script_action_run ()
script_get_loaded_plugins ();
actions = weechat_string_split (script_actions, "\n",
actions = weechat_string_split (script_actions, "\n", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
@@ -1217,6 +1217,7 @@ script_action_run ()
argv = weechat_string_split (
ptr_action,
" ",
NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
@@ -1225,6 +1226,7 @@ script_action_run ()
argv_eol = weechat_string_split (
ptr_action,
" ",
NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS
+1
View File
@@ -261,6 +261,7 @@ script_completion_tags_cb (const void *pointer, void *data,
list_tags = weechat_string_split (
ptr_script->tags,
",",
NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
+3 -1
View File
@@ -114,7 +114,7 @@ script_config_get_diff_command ()
result[0] = '\0';
if (dir_separator && path)
{
paths = weechat_string_split (path, ":",
paths = weechat_string_split (path, ":", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
@@ -299,6 +299,7 @@ script_config_hold (const char *name_with_extension)
items = weechat_string_split (
weechat_config_string (script_config_scripts_hold),
",",
NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
@@ -348,6 +349,7 @@ script_config_unhold (const char *name_with_extension)
items = weechat_string_split (
weechat_config_string (script_config_scripts_hold),
",",
NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
+6 -3
View File
@@ -943,16 +943,19 @@ script_repo_match_filter (struct t_script_repo *script)
if (!script_repo_filter || strcmp (script_repo_filter, "*") == 0)
return 1;
words = weechat_string_split (script_repo_filter, " ",
words = weechat_string_split (script_repo_filter, " ", NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
0, &num_words);
tags = weechat_string_split ((script->tags) ? script->tags : "", ",",
tags = weechat_string_split ((script->tags) ? script->tags : "",
",",
NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
0, &num_tags);
0,
&num_tags);
if (words)
{
for (i = 0; i < num_words; i++)