Kaydet (Commit) a89fcc2c authored tarafından Colomban Wendling's avatar Colomban Wendling

Fix utils_string_replace_all() to accept a NULL replacement again

Support of NULL as the replacement was lost in the code refactoring
introduced by revision 5730, and it broke a few plugins.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5965 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 95222582
2011-09-28 Colomban Wendling <colomban(at)geany(dot)org>
* src/utils.c:
Fix utils_string_replace_all() to accept a NULL replacement again.
2011-09-26 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> 2011-09-26 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/editor.c: * src/editor.c:
......
...@@ -1556,9 +1556,13 @@ gint utils_string_find(GString *haystack, gint start, gint end, const gchar *nee ...@@ -1556,9 +1556,13 @@ gint utils_string_find(GString *haystack, gint start, gint end, const gchar *nee
gint utils_string_replace(GString *str, gint pos, gint len, const gchar *replace) gint utils_string_replace(GString *str, gint pos, gint len, const gchar *replace)
{ {
g_string_erase(str, pos, len); g_string_erase(str, pos, len);
g_string_insert(str, pos, replace); if (replace)
{
g_string_insert(str, pos, replace);
pos += strlen(replace);
}
return pos + strlen(replace); return pos;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment