diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2020-11-13 21:26:16 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2020-11-13 21:30:06 +0100 |
commit | eb90a73fe811e2de0e0646abf10242e639a7b1a1 (patch) | |
tree | 0321a9367f92c4c8b21bc7fc5c97da78aecafb3a | |
parent | 4065d32e685ad0db1c46dc245ed067d3786d3d09 (diff) | |
download | weechat-eb90a73fe811e2de0e0646abf10242e639a7b1a1.zip |
spell: fix refresh of bar item "spell_suggest" when the input becomes empty (closes #1586)
When the input is empty, length of string is zero: when sending zero to
function weechat_string_dyn_alloc, the function returns NULL and therefore we
return immediately instead of handling the empty input, which is a valid value.
The regression was introduced by the use of dynamic strings, commit:
299f74bfef9e0d239ad141a4df3b2dcf11a4c0da
-rw-r--r-- | ChangeLog.adoc | 7 | ||||
-rw-r--r-- | src/plugins/spell/spell.c | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index db74d5bad..21d156859 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -15,6 +15,13 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] (file _ReleaseNotes.adoc_ in sources). +[[v3.1]] +== Version 3.1 (under dev) + +Bug fixes:: + + * spell: fix refresh of bar item "spell_suggest" when the input becomes empty (issue #1586) + [[v3.0]] == Version 3.0 (2020-11-11) diff --git a/src/plugins/spell/spell.c b/src/plugins/spell/spell.c index 62a88388c..e9278e995 100644 --- a/src/plugins/spell/spell.c +++ b/src/plugins/spell/spell.c @@ -801,7 +801,7 @@ spell_modifier_cb (const void *pointer, void *data, color_error = weechat_color (weechat_config_string (spell_config_color_misspelled)); length = strlen (string); - result = weechat_string_dyn_alloc (length * 2); + result = weechat_string_dyn_alloc ((length * 2) + 1); if (!result) return NULL; |