tFix for segfault in the case where gtk_rc_get_style returns NULL. - vaccinewars - be a doctor and try to vaccinate the world
(HTM) git clone git://src.adamsgaard.dk/vaccinewars
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 38ffefd3a56c63ece9ed2fe03e9d8371565cb3ae
(DIR) parent 1b199ac41840a2fb61c471c0d7479967e1ec3a0a
(HTM) Author: Ben Webb <ben@salilab.org>
Date: Mon, 24 Jun 2002 17:57:48 +0000
Fix for segfault in the case where gtk_rc_get_style returns NULL.
Diffstat:
M src/gtkport/gtkport.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/src/gtkport/gtkport.c b/src/gtkport/gtkport.c
t@@ -5320,7 +5320,11 @@ GtkWidget *gtk_url_new(const gchar *text, const gchar *target,
label = gtk_label_new(text);
/* Set the text colour */
- style = gtk_style_copy(gtk_rc_get_style(label));
+ style = gtk_rc_get_style(label);
+ if (!style) {
+ style = label->style;
+ }
+ style = gtk_style_copy(style);
style->fg[GTK_STATE_NORMAL] = color;
gtk_widget_set_style(label, style);