diff --git a/ChangeLog b/ChangeLog index fa272d508c..4d4dc54b3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Mon Sep 10 06:50:39 2001 Owen Taylor + + * gtk/gtkstyle.c (_gtk_style_peek_property_value): Don't + do a lookup immediately after creating style->property_cache, + since bsearch crashes on zero length for Solaris. + (Found by Padraig O'Briain.) + 2001-09-09 Alexander Larsson   * gtk/gtkwidget.c (_gtk_widget_peek_colormap): diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index fa272d508c..4d4dc54b3e 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,10 @@ +Mon Sep 10 06:50:39 2001 Owen Taylor + + * gtk/gtkstyle.c (_gtk_style_peek_property_value): Don't + do a lookup immediately after creating style->property_cache, + since bsearch crashes on zero length for Solaris. + (Found by Padraig O'Briain.) + 2001-09-09 Alexander Larsson   * gtk/gtkwidget.c (_gtk_widget_peek_colormap): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index fa272d508c..4d4dc54b3e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +Mon Sep 10 06:50:39 2001 Owen Taylor + + * gtk/gtkstyle.c (_gtk_style_peek_property_value): Don't + do a lookup immediately after creating style->property_cache, + since bsearch crashes on zero length for Solaris. + (Found by Padraig O'Briain.) + 2001-09-09 Alexander Larsson   * gtk/gtkwidget.c (_gtk_widget_peek_colormap): diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index fa272d508c..4d4dc54b3e 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,10 @@ +Mon Sep 10 06:50:39 2001 Owen Taylor + + * gtk/gtkstyle.c (_gtk_style_peek_property_value): Don't + do a lookup immediately after creating style->property_cache, + since bsearch crashes on zero length for Solaris. + (Found by Padraig O'Briain.) + 2001-09-09 Alexander Larsson   * gtk/gtkwidget.c (_gtk_widget_peek_colormap): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index fa272d508c..4d4dc54b3e 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +Mon Sep 10 06:50:39 2001 Owen Taylor + + * gtk/gtkstyle.c (_gtk_style_peek_property_value): Don't + do a lookup immediately after creating style->property_cache, + since bsearch crashes on zero length for Solaris. + (Found by Padraig O'Briain.) + 2001-09-09 Alexander Larsson   * gtk/gtkwidget.c (_gtk_widget_peek_colormap): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index fa272d508c..4d4dc54b3e 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +Mon Sep 10 06:50:39 2001 Owen Taylor + + * gtk/gtkstyle.c (_gtk_style_peek_property_value): Don't + do a lookup immediately after creating style->property_cache, + since bsearch crashes on zero length for Solaris. + (Found by Padraig O'Briain.) + 2001-09-09 Alexander Larsson   * gtk/gtkwidget.c (_gtk_widget_peek_colormap): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index fa272d508c..4d4dc54b3e 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +Mon Sep 10 06:50:39 2001 Owen Taylor + + * gtk/gtkstyle.c (_gtk_style_peek_property_value): Don't + do a lookup immediately after creating style->property_cache, + since bsearch crashes on zero length for Solaris. + (Found by Padraig O'Briain.) + 2001-09-09 Alexander Larsson   * gtk/gtkwidget.c (_gtk_widget_peek_colormap): diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c index 8461e4d4d3..8c90bf89b6 100644 --- a/gtk/gtkstyle.c +++ b/gtk/gtkstyle.c @@ -1303,15 +1303,16 @@ _gtk_style_peek_property_value (GtkStyle *style, /* need value cache array */ if (!style->property_cache) style->property_cache = g_array_new (FALSE, FALSE, sizeof (PropertyValue)); - - /* lookup, or insert value if not yet present */ - key.widget_type = widget_type; - key.pspec = pspec; - pcache = bsearch (&key, - style->property_cache->data, style->property_cache->len, - sizeof (PropertyValue), style_property_values_cmp); - if (pcache) - return &pcache->value; + else + { + key.widget_type = widget_type; + key.pspec = pspec; + pcache = bsearch (&key, + style->property_cache->data, style->property_cache->len, + sizeof (PropertyValue), style_property_values_cmp); + if (pcache) + return &pcache->value; + } i = 0; while (i < style->property_cache->len &&