changeset 23296:47492dabcb4a

Fixes a crash when next_begin_word is called on trailing spaces at the end of an entry. applied changes from 0b25c9dd3deaa5c16f7deff33c36af4812f2629a through abef8860abbb7cbebfd89a34d86d43457c0b5caf
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 06 Jun 2008 03:04:05 +0000
parents 5e6392e93ce9
children f8e0a90dd153
files finch/libgnt/gntentry.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/finch/libgnt/gntentry.c	Thu Jun 05 23:55:01 2008 +0000
+++ b/finch/libgnt/gntentry.c	Fri Jun 06 03:04:05 2008 +0000
@@ -580,11 +580,13 @@
 	while (text && text < end && g_unichar_isspace(g_utf8_get_char(text)))
 		text = g_utf8_find_next_char(text, end);
 
-	ch = g_utf8_get_char(text);
-	while ((text = g_utf8_find_next_char(text, end)) != NULL && text <= end) {
-		gunichar cur = g_utf8_get_char(text);
-		if (!SAME(ch, cur))
-			break;
+	if (text) {
+		ch = g_utf8_get_char(text);
+		while ((text = g_utf8_find_next_char(text, end)) != NULL && text <= end) {
+			gunichar cur = g_utf8_get_char(text);
+			if (!SAME(ch, cur))
+				break;
+		}
 	}
 	return (text ? text : end);
 }