openbsd-ports/editors/glimmer/patches/patch-src_mdi-routines_c
naddy 4ce0dc6944 - Fix dependencies.
- Clean-up, bug fixes.
From: Jim Geovedi <jim@corebsd.or.id>
2002-10-11 18:40:46 +00:00

24 lines
1.0 KiB
Plaintext

$OpenBSD: patch-src_mdi-routines_c,v 1.1 2002/10/11 18:40:46 naddy Exp $
--- src/mdi-routines.c.orig Fri Oct 11 18:04:32 2002
+++ src/mdi-routines.c Fri Oct 11 18:05:54 2002
@@ -150,7 +150,7 @@ file_pos_changed (GtkWidget * widget, gi
length = text->length;
line = text->line_number + 1;
lines = GTK_EXTEXT (cur_file->text)->line_count + 1;
- if (pos >= 0 && pos <= text->length && text->length > 0)
+ if (pos >= 0 && pos < text->length && text->length > 0)
cur_char = GTK_EXTEXT_INDEX (text, pos);
else
cur_char = 0;
@@ -167,6 +167,10 @@ file_pos_changed (GtkWidget * widget, gi
gtk_widget_set_sensitive (search_menu_match, TRUE);
cur_char = GTK_EXTEXT_INDEX (text, pos);
+ if (pos < text->length)
+ cur_char = GTK_EXTEXT_INDEX (text, pos);
+ else
+ cur_char = 0;
if (cur_char < 1 || !strchr ("{[()]}", cur_char) || length < 1)
gtk_widget_set_sensitive (search_menu_select, FALSE);
else