summaryrefslogtreecommitdiff
path: root/doc/en/weechat_plugin_api.en.asciidoc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/en/weechat_plugin_api.en.asciidoc')
-rw-r--r--doc/en/weechat_plugin_api.en.asciidoc13
1 files changed, 11 insertions, 2 deletions
diff --git a/doc/en/weechat_plugin_api.en.asciidoc b/doc/en/weechat_plugin_api.en.asciidoc
index ffc2130ef..c4a87d81a 100644
--- a/doc/en/weechat_plugin_api.en.asciidoc
+++ b/doc/en/weechat_plugin_api.en.asciidoc
@@ -1452,7 +1452,7 @@ C example:
----
char **argv;
int argc;
-argv = weechat_string_split ("abc de fghi", " ", 0, 0, &argc);
+argv = weechat_string_split ("abc de fghi ", " ", 0, 0, &argc);
/* result: argv[0] == "abc"
argv[1] == "de"
argv[2] == "fghi"
@@ -1461,7 +1461,7 @@ argv = weechat_string_split ("abc de fghi", " ", 0, 0, &argc);
*/
weechat_string_free_split (argv);
-argv = weechat_string_split ("abc de fghi", " ", 1, 0, &argc);
+argv = weechat_string_split ("abc de fghi ", " ", 1, 0, &argc);
/* result: argv[0] == "abc de fghi"
argv[1] == "de fghi"
argv[2] == "fghi"
@@ -1469,6 +1469,15 @@ argv = weechat_string_split ("abc de fghi", " ", 1, 0, &argc);
argc == 3
*/
weechat_string_free_split (argv);
+
+argv = weechat_string_split ("abc de fghi ", " ", 2, 0, &argc);
+/* result: argv[0] == "abc de fghi "
+ argv[1] == "de fghi "
+ argv[2] == "fghi "
+ argv[3] == NULL
+ argc == 3
+*/
+weechat_string_free_split (argv);
----
[NOTE]