aboutsummaryrefslogtreecommitdiffstats
path: root/editors/glimmer
diff options
context:
space:
mode:
authormarcus <marcus@FreeBSD.org>2002-05-08 02:58:25 +0800
committermarcus <marcus@FreeBSD.org>2002-05-08 02:58:25 +0800
commit7f5149bb9efc376406183db731e5280cd26520c9 (patch)
tree62ba17c6c2e9e20e1374e13f130ac04559f5ede6 /editors/glimmer
parent6c6809d018a8eaa0f0d4626838392c22a431e9f4 (diff)
downloadfreebsd-ports-graphics-7f5149bb9efc376406183db731e5280cd26520c9.tar.gz
freebsd-ports-graphics-7f5149bb9efc376406183db731e5280cd26520c9.tar.zst
freebsd-ports-graphics-7f5149bb9efc376406183db731e5280cd26520c9.zip
Fix a spurious crash when invoking the editor on certain C files.
PR: 37785
Diffstat (limited to 'editors/glimmer')
-rw-r--r--editors/glimmer/Makefile1
-rw-r--r--editors/glimmer/files/patch-src_mdi-routines.c23
2 files changed, 24 insertions, 0 deletions
diff --git a/editors/glimmer/Makefile b/editors/glimmer/Makefile
index f1a2378c141..ce8f0a847fe 100644
--- a/editors/glimmer/Makefile
+++ b/editors/glimmer/Makefile
@@ -7,6 +7,7 @@
PORTNAME= glimmer
PORTVERSION= 1.2.1
+PORTREVISION= 1
CATEGORIES= editors gnome python
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
diff --git a/editors/glimmer/files/patch-src_mdi-routines.c b/editors/glimmer/files/patch-src_mdi-routines.c
new file mode 100644
index 00000000000..538cf80ed74
--- /dev/null
+++ b/editors/glimmer/files/patch-src_mdi-routines.c
@@ -0,0 +1,23 @@
+--- src/mdi-routines.c.orig Tue May 7 13:35:06 2002
++++ src/mdi-routines.c Tue May 7 13:40:16 2002
+@@ -150,7 +150,7 @@
+ 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;
+@@ -166,7 +166,10 @@
+ else
+ 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