After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 153628 - gtk_text_iter_inside_word() returns unexpected value.
gtk_text_iter_inside_word() returns unexpected value.
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
2.4.x
Other opensolaris
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2004-09-24 10:57 UTC by padraig.obriain
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test program (1.70 KB, text/plain)
2004-09-24 10:59 UTC, padraig.obriain
  Details
Proposed patch (592 bytes, patch)
2004-09-24 11:04 UTC, padraig.obriain
none Details | Review

Description padraig.obriain 2004-09-24 10:57:26 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.
Comment 1 padraig.obriain 2004-09-24 10:59:22 UTC
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.
Comment 2 padraig.obriain 2004-09-24 11:02:31 UTC
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.
Comment 3 padraig.obriain 2004-09-24 11:04:51 UTC
Created attachment 31897 [details] [review]
Proposed patch
Comment 4 Matthias Clasen 2004-09-25 04:30:13 UTC
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)