[gdm/gnome-2-30] Don't crash on markup parse failure
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm/gnome-2-30] Don't crash on markup parse failure
- Date: Fri, 11 Jun 2010 05:50:24 +0000 (UTC)
commit a0ee7030473bc331c01a1fd46b4880638843ce13
Author: William Jon McCann <jmccann redhat com>
Date: Fri Jun 11 01:38:02 2010 -0400
Don't crash on markup parse failure
https://bugzilla.gnome.org/show_bug.cgi?id=619588
gui/simple-greeter/gdm-chooser-widget.c | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-chooser-widget.c b/gui/simple-greeter/gdm-chooser-widget.c
index a52b687..7153c93 100644
--- a/gui/simple-greeter/gdm-chooser-widget.c
+++ b/gui/simple-greeter/gdm-chooser-widget.c
@@ -1501,8 +1501,6 @@ compare_item (GtkTreeModel *model,
GdmChooserWidget *widget;
char *name_a;
char *name_b;
- char *text_a;
- char *text_b;
gulong prio_a;
gulong prio_b;
gboolean is_separate_a;
@@ -1571,12 +1569,24 @@ compare_item (GtkTreeModel *model,
result *= direction;
} else if (is_separate_b == is_separate_a) {
if (prio_a == prio_b) {
+ char *text_a;
+ char *text_b;
+
+ text_a = NULL;
+ text_b = NULL;
pango_parse_markup (name_a, -1, 0, &attrs, &text_a, NULL, NULL);
+ if (text_a == NULL) {
+ g_debug ("GdmChooserWidget: unable to parse markup: '%s'", name_a);
+ }
pango_parse_markup (name_b, -1, 0, &attrs, &text_b, NULL, NULL);
- if (text_a && text_b)
- result = g_utf8_collate (text_a, text_b);
- else
- result = g_utf8_collate (name_a, name_b);
+ if (text_b == NULL) {
+ g_debug ("GdmChooserWidget: unable to parse markup: '%s'", name_b);
+ }
+ if (text_a != NULL && text_b != NULL) {
+ result = g_utf8_collate (text_a, text_b);
+ } else {
+ result = g_utf8_collate (name_a, name_b);
+ }
g_free (text_a);
g_free (text_b);
} else if (prio_a > prio_b) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]