summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.asciidoc1
-rw-r--r--doc/en/weechat_plugin_api.en.asciidoc4
-rw-r--r--doc/fr/weechat_plugin_api.fr.asciidoc4
-rw-r--r--doc/it/weechat_plugin_api.it.asciidoc4
-rw-r--r--doc/ja/weechat_plugin_api.ja.asciidoc4
-rw-r--r--src/core/wee-string.c6
-rw-r--r--src/core/wee-string.h2
-rw-r--r--src/gui/gui-color.c4
-rw-r--r--src/plugins/weechat-plugin.h4
9 files changed, 17 insertions, 16 deletions
diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc
index 74aa8a402..a34edc4a5 100644
--- a/ChangeLog.asciidoc
+++ b/ChangeLog.asciidoc
@@ -40,6 +40,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
* core: fix bar item "scroll" after /buffer clear (closes #448)
* core: fix display of time in bare display when option
weechat.look.buffer_time_format is set to empty string (closes #441)
+* api: fix type of value returned by function strcasestr
* fifo: fix send error on Cygwin when something is received in the pipe
(closes #436)
* irc: decode/encode only text in IRC messages and not the headers
diff --git a/doc/en/weechat_plugin_api.en.asciidoc b/doc/en/weechat_plugin_api.en.asciidoc
index 369d62782..4c70662a9 100644
--- a/doc/en/weechat_plugin_api.en.asciidoc
+++ b/doc/en/weechat_plugin_api.en.asciidoc
@@ -763,7 +763,7 @@ Prototype:
[source,C]
----
-char *weechat_strcasestr (const char *string, const char *search);
+const char *weechat_strcasestr (const char *string, const char *search);
----
Arguments:
@@ -779,7 +779,7 @@ C example:
[source,C]
----
-char *pos = weechat_strcasestr ("aBcDeF", "de"); /* result: pointer to "DeF" */
+const char *pos = weechat_strcasestr ("aBcDeF", "de"); /* result: pointer to "DeF" */
----
[NOTE]
diff --git a/doc/fr/weechat_plugin_api.fr.asciidoc b/doc/fr/weechat_plugin_api.fr.asciidoc
index 8baf089d8..3b0aeb5ba 100644
--- a/doc/fr/weechat_plugin_api.fr.asciidoc
+++ b/doc/fr/weechat_plugin_api.fr.asciidoc
@@ -772,7 +772,7 @@ Prototype :
[source,C]
----
-char *weechat_strcasestr (const char *string, const char *search);
+const char *weechat_strcasestr (const char *string, const char *search);
----
Paramètres :
@@ -788,7 +788,7 @@ Exemple en C :
[source,C]
----
-char *pos = weechat_strcasestr ("aBcDeF", "de"); /* résultat : pointeur vers "DeF" */
+const char *pos = weechat_strcasestr ("aBcDeF", "de"); /* résultat : pointeur vers "DeF" */
----
[NOTE]
diff --git a/doc/it/weechat_plugin_api.it.asciidoc b/doc/it/weechat_plugin_api.it.asciidoc
index 9f148893f..a12515ec0 100644
--- a/doc/it/weechat_plugin_api.it.asciidoc
+++ b/doc/it/weechat_plugin_api.it.asciidoc
@@ -795,7 +795,7 @@ Prototipo:
[source,C]
----
-char *weechat_strcasestr (const char *string, const char *search);
+const char *weechat_strcasestr (const char *string, const char *search);
----
Argomenti:
@@ -811,7 +811,7 @@ Esempio in C:
[source,C]
----
-char *pos = weechat_strcasestr ("aBcDeF", "de"); /* risultato: puntatore a "DeF" */
+const char *pos = weechat_strcasestr ("aBcDeF", "de"); /* risultato: puntatore a "DeF" */
----
[NOTE]
diff --git a/doc/ja/weechat_plugin_api.ja.asciidoc b/doc/ja/weechat_plugin_api.ja.asciidoc
index 66035ba09..cbd7e72fb 100644
--- a/doc/ja/weechat_plugin_api.ja.asciidoc
+++ b/doc/ja/weechat_plugin_api.ja.asciidoc
@@ -767,7 +767,7 @@ int diff = weechat_strcmp_ignore_chars ("a-b", "--a-e", "-", 1); /* == -3 */
[source,C]
----
-char *weechat_strcasestr (const char *string, const char *search);
+const char *weechat_strcasestr (const char *string, const char *search);
----
引数:
@@ -783,7 +783,7 @@ C 言語での使用例:
[source,C]
----
-char *pos = weechat_strcasestr ("aBcDeF", "de"); /* result: pointer to "DeF" */
+const char *pos = weechat_strcasestr ("aBcDeF", "de"); /* result: pointer to "DeF" */
----
[NOTE]
diff --git a/src/core/wee-string.c b/src/core/wee-string.c
index 28e960c18..35e5a7ec5 100644
--- a/src/core/wee-string.c
+++ b/src/core/wee-string.c
@@ -341,7 +341,7 @@ string_strcmp_ignore_chars (const char *string1, const char *string2,
* Returns pointer to string found, or NULL if not found.
*/
-char *
+const char *
string_strcasestr (const char *string, const char *search)
{
int length_search;
@@ -1051,8 +1051,8 @@ string_regcomp (void *preg, const char *regex, int default_flags)
int
string_has_highlight (const char *string, const char *highlight_words)
{
- char *msg, *highlight, *match, *match_pre, *match_post, *msg_pos;
- char *pos, *pos_end;
+ const char *match, *match_pre, *match_post, *msg_pos;
+ char *msg, *highlight, *pos, *pos_end;
int end, length, startswith, endswith, wildcard_start, wildcard_end, flags;
if (!string || !string[0] || !highlight_words || !highlight_words[0])
diff --git a/src/core/wee-string.h b/src/core/wee-string.h
index 0c0b1f807..45df857b5 100644
--- a/src/core/wee-string.h
+++ b/src/core/wee-string.h
@@ -38,7 +38,7 @@ extern int string_strcmp_ignore_chars (const char *string1,
const char *string2,
const char *chars_ignored,
int case_sensitive);
-extern char *string_strcasestr (const char *string, const char *search);
+extern const char *string_strcasestr (const char *string, const char *search);
extern int string_match (const char *string, const char *mask,
int case_sensitive);
extern char *string_replace (const char *string, const char *search,
diff --git a/src/gui/gui-color.c b/src/gui/gui-color.c
index 5b8792ac9..470bc7a97 100644
--- a/src/gui/gui-color.c
+++ b/src/gui/gui-color.c
@@ -1001,8 +1001,8 @@ gui_color_emphasize (const char *string,
regex_t *regex)
{
regmatch_t regex_match;
- char *result, *result2, *string_no_color, *pos;
- const char *ptr_string, *ptr_no_color, *color_emphasis;
+ char *result, *result2, *string_no_color;
+ const char *ptr_string, *ptr_no_color, *color_emphasis, *pos;
int rc, length_search, length_emphasis, length_result;
int pos1, pos2, real_pos1, real_pos2, count_emphasis;
diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h
index 3987e3b15..f5d99226e 100644
--- a/src/plugins/weechat-plugin.h
+++ b/src/plugins/weechat-plugin.h
@@ -57,7 +57,7 @@ struct timeval;
* please change the date with current one; for a second change at same
* date, increment the 01, otherwise please keep 01.
*/
-#define WEECHAT_PLUGIN_API_VERSION "20150624-01"
+#define WEECHAT_PLUGIN_API_VERSION "20150703-01"
/* macros for defining plugin infos */
#define WEECHAT_PLUGIN_NAME(__name) \
@@ -269,7 +269,7 @@ struct t_weechat_plugin
int max, int range);
int (*strcmp_ignore_chars) (const char *string1, const char *string2,
const char *chars_ignored, int case_sensitive);
- char *(*strcasestr) (const char *string, const char *search);
+ const char *(*strcasestr) (const char *string, const char *search);
int (*strlen_screen) (const char *string);
int (*string_match) (const char *string, const char *mask,
int case_sensitive);