Applied a patch by Enrico to improve code of htmlchars plugin

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3650 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Frank Lanitz 2009-03-24 20:35:28 +00:00
parent 10ea2cc7ba
commit c7a62c6b3d

View File

@ -613,18 +613,18 @@ static void replace_special_character()
if (doc != NULL && sci_has_selection(doc->editor->sci))
{
gint selection_len;
gchar *selection = NULL;
guint selection_len;
gchar *selection;
GString *replacement = g_string_new(NULL);
gint i;
gchar *new = NULL;
guint i;
gchar *new;
const gchar *entity = NULL;
gchar buf[7];
gint len;
selection = sci_get_selection_contents(doc->editor->sci);
selection_len = sci_get_selected_text_length(doc->editor->sci) - 1;
selection_len = strlen(selection);
for (i = 0; i < selection_len; i++)
{
len = g_unichar_to_utf8(g_utf8_get_char(selection + i), buf);
@ -641,7 +641,6 @@ static void replace_special_character()
{
replacement = g_string_append(replacement, buf);
}
}
new = g_string_free(replacement, FALSE);
sci_replace_sel(doc->editor->sci, new);