SF.net SVN: geany:[3650] trunk/plugins/htmlchars.c

frlan at users.sourceforge.net frlan at xxxxx
Tue Mar 24 20:35:28 UTC 2009


Revision: 3650
          http://geany.svn.sourceforge.net/geany/?rev=3650&view=rev
Author:   frlan
Date:     2009-03-24 20:35:28 +0000 (Tue, 24 Mar 2009)

Log Message:
-----------
Applied a patch by Enrico to improve code of htmlchars plugin

Modified Paths:
--------------
    trunk/plugins/htmlchars.c

Modified: trunk/plugins/htmlchars.c
===================================================================
--- trunk/plugins/htmlchars.c	2009-03-24 18:45:16 UTC (rev 3649)
+++ trunk/plugins/htmlchars.c	2009-03-24 20:35:28 UTC (rev 3650)
@@ -613,18 +613,18 @@
 
 	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 @@
 			{
 				replacement = g_string_append(replacement, buf);
 			}
-
 		}
 		new = g_string_free(replacement, FALSE);
 		sci_replace_sel(doc->editor->sci, new);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list