1
0
mirror of https://gitlab.gnome.org/GNOME/nautilus synced 2024-07-04 17:30:47 +00:00

Don't move past end of string (#569165).

2009-03-09  Alexander Larsson  <alexl@redhat.com>

        * eel-editable-label.c:
	(eel_editable_label_move_forward_word):
	Don't move past end of string (#569165).


svn path=/trunk/; revision=15073
This commit is contained in:
Alexander Larsson 2009-03-09 11:36:54 +00:00 committed by Alexander Larsson
parent 61de29e5d9
commit ccba144639
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2009-03-09 Alexander Larsson <alexl@redhat.com>
* eel-editable-label.c:
(eel_editable_label_move_forward_word):
Don't move past end of string (#569165).
2009-03-09 Alexander Larsson <alexl@redhat.com>
* eel-editable-label.c:

View File

@ -2756,10 +2756,11 @@ eel_editable_label_move_forward_word (EelEditableLabel *label,
eel_editable_label_ensure_layout (label, FALSE);
pango_layout_get_log_attrs (label->layout, &log_attrs, &n_attrs);
/* Find the next word end */
/* Find the next word end,
(remember, n_attrs is one more than the number of of chars) */
new_pos++;
while (new_pos < n_attrs && !log_attrs[new_pos].is_word_end)
while (new_pos < (n_attrs - 1) && !log_attrs[new_pos].is_word_end)
new_pos++;
g_free (log_attrs);