anjuta r4151 - in trunk: . plugins/search



Author: jhs
Date: Mon Aug 18 14:15:06 2008
New Revision: 4151
URL: http://svn.gnome.org/viewvc/anjuta?rev=4151&view=rev

Log:
2008-08-18  Johannes Schmid  <jhs gnome org>

	* plugins/search/search-replace_backend.c (get_next_match):
	Use uf8_strlen instead of strlen to avoid selection problem with
	non-ASCII search strings (see #440637 comment 15)

Modified:
   trunk/ChangeLog
   trunk/plugins/search/search-replace_backend.c

Modified: trunk/plugins/search/search-replace_backend.c
==============================================================================
--- trunk/plugins/search/search-replace_backend.c	(original)
+++ trunk/plugins/search/search-replace_backend.c	Mon Aug 18 14:15:06 2008
@@ -509,7 +509,7 @@
 		gboolean found;
 		gint match_len;
 
-		match_len = strlen (s->search_str);
+		match_len = g_utf8_strlen (s->search_str, -1);
 		if (match_len == 0)
 			return NULL;
 
@@ -614,15 +614,10 @@
 		if (found)
 		{
 			mi = g_new0 (MatchInfo, 1);	//better to abort than silently fail to report match ?
-//			mi = g_try_new0 (MatchInfo, 1);
-//			if (mi)
-//			{
-				mi->pos = fb->pos;
-				mi->len = match_len;
-				mi->line = file_buffer_line_from_pos (fb, fb->pos);
-//			}
-//			else
-//				WARN USER ABOUT MEMORY ERROR
+			mi->pos = fb->pos;
+			mi->len = match_len;
+			mi->line = file_buffer_line_from_pos (fb, fb->pos);
+			
 			if (direction == SD_BACKWARD)
 				fb->pos -= match_len;
 			else



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]