From de4cf94bc273c379cee8e4d04fdd1bb3628de5f9 Mon Sep 17 00:00:00 2001 From: Manish Singh Date: Wed, 25 Sep 2002 06:54:58 +0000 Subject: [PATCH] check if last_selected is valid before doing a strcmp on it, which may Tue Sep 24 23:54:20 2002 Manish Singh * gtk/gtkfilesel.c: check if last_selected is valid before doing a strcmp on it, which may happen if selections happen programmatically instead of through the UI (#86566) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-2 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkfilesel.c | 3 ++- 7 files changed, 38 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f8276b0b4a..67692edd26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Sep 24 23:54:20 2002 Manish Singh + + * gtk/gtkfilesel.c: check if last_selected is valid before doing + a strcmp on it, which may happen if selections happen programmatically + instead of through the UI (#86566) + Tue Sep 24 23:33:48 2002 Manish Singh * gtk/gtkfilesel.c: preserve ordering from gtk_tree_selection_foreach diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index f8276b0b4a..67692edd26 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Tue Sep 24 23:54:20 2002 Manish Singh + + * gtk/gtkfilesel.c: check if last_selected is valid before doing + a strcmp on it, which may happen if selections happen programmatically + instead of through the UI (#86566) + Tue Sep 24 23:33:48 2002 Manish Singh * gtk/gtkfilesel.c: preserve ordering from gtk_tree_selection_foreach diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index f8276b0b4a..67692edd26 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Tue Sep 24 23:54:20 2002 Manish Singh + + * gtk/gtkfilesel.c: check if last_selected is valid before doing + a strcmp on it, which may happen if selections happen programmatically + instead of through the UI (#86566) + Tue Sep 24 23:33:48 2002 Manish Singh * gtk/gtkfilesel.c: preserve ordering from gtk_tree_selection_foreach diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index f8276b0b4a..67692edd26 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Tue Sep 24 23:54:20 2002 Manish Singh + + * gtk/gtkfilesel.c: check if last_selected is valid before doing + a strcmp on it, which may happen if selections happen programmatically + instead of through the UI (#86566) + Tue Sep 24 23:33:48 2002 Manish Singh * gtk/gtkfilesel.c: preserve ordering from gtk_tree_selection_foreach diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index f8276b0b4a..67692edd26 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Tue Sep 24 23:54:20 2002 Manish Singh + + * gtk/gtkfilesel.c: check if last_selected is valid before doing + a strcmp on it, which may happen if selections happen programmatically + instead of through the UI (#86566) + Tue Sep 24 23:33:48 2002 Manish Singh * gtk/gtkfilesel.c: preserve ordering from gtk_tree_selection_foreach diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index f8276b0b4a..67692edd26 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Tue Sep 24 23:54:20 2002 Manish Singh + + * gtk/gtkfilesel.c: check if last_selected is valid before doing + a strcmp on it, which may happen if selections happen programmatically + instead of through the UI (#86566) + Tue Sep 24 23:33:48 2002 Manish Singh * gtk/gtkfilesel.c: preserve ordering from gtk_tree_selection_foreach diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index a4e7a9191d..b794222eb5 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -2301,7 +2301,8 @@ gtk_file_selection_file_changed (GtkTreeSelection *selection, * was selected, which is used for subsequent range selections. * So search up from there. */ - if (compare_filenames (fs->last_selected, + if (fs->last_selected && + compare_filenames (fs->last_selected, g_ptr_array_index (new_names, 0)) == 0) index = new_names->len - 1; else