GNOME Bugzilla – Bug 153628
gtk_text_iter_inside_word() returns unexpected value.
Last modified: 2004-12-22 21:47:04 UTC
Conside a GtkTextBuffer containing the text "hello world\n test". If the text iter is at offset 12, i.e. the spaced after the NL character gtk_text_iter_inside_word() returns TRUE instead of FALSE.
Created attachment 31896 [details] Test program The attached test program shows the calls being made in gail. I was not able to reproduce the problem which I see in gail with the test program.
While trying to understand what was happening I noticed that the offset value in inside_word_func was decremented to -1. This makes the statement attrs[offset].is_word_start problematic.
Created attachment 31897 [details] [review] Proposed patch
2004-09-25 Matthias Clasen <mclasen@x1-6-00-50-fc-70-9f-e0> * gtk/gtktextiter.c (inside_word_func): Don't access attr[-1]. (#153628, Padraig O'Briain)