summaryrefslogtreecommitdiff
path: root/gtk/gtktextiter.c
diff options
context:
space:
mode:
authorSébastien Wilmet <swilmet@gnome.org>2014-07-31 14:11:49 +0200
committerSébastien Wilmet <swilmet@gnome.org>2014-07-31 18:00:49 +0200
commit6e4e7c22a028171c9c2df7041b036878b5bcbf42 (patch)
tree9fe7f9ee6f6e24101cc51a69b3fdb116f38509bf /gtk/gtktextiter.c
parent5041d4507f463ae2306ceec070ef69f479c7d291 (diff)
downloadgtk+-6e4e7c22a028171c9c2df7041b036878b5bcbf42.tar.gz
textiter: don't call g_utf8_prev_char() on start of string
Changes also the "goto finally" with a break. A break is more common. Another way is to use g_utf8_find_prev_char(). https://bugzilla.gnome.org/show_bug.cgi?id=638709
Diffstat (limited to 'gtk/gtktextiter.c')
-rw-r--r--gtk/gtktextiter.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c
index 5a53581252..53fe4dbd16 100644
--- a/gtk/gtktextiter.c
+++ b/gtk/gtktextiter.c
@@ -4641,14 +4641,17 @@ utf8_strrcasestr (const gchar *haystack,
p = g_utf8_offset_to_pointer (caseless_haystack, i);
needle_len = strlen (needle);
- while (p >= caseless_haystack)
+ while (TRUE)
{
if (exact_prefix_cmp (p, needle, needle_len))
{
ret = pointer_from_offset_skipping_decomp (haystack, i);
- goto finally;
+ break;
}
+ if (p == caseless_haystack)
+ break;
+
p = g_utf8_prev_char (p);
i--;
}