# HG changeset patch # User Andreas Schwab # Date 1213524804 0 # Node ID fbdde312e09d01df5ba338ce863fcdaf736c2d4f # Parent 42fbae40c9e0aec1811ba12e1ea534f9595b6330 (font_update_drivers): Fix crash when no drivers match. diff -r 42fbae40c9e0 -r fbdde312e09d src/ChangeLog --- a/src/ChangeLog Sun Jun 15 09:43:38 2008 +0000 +++ b/src/ChangeLog Sun Jun 15 10:13:24 2008 +0000 @@ -1,3 +1,7 @@ +2008-06-15 Andreas Schwab + + * font.c (font_update_drivers): Fix crash when no drivers match. + 2008-06-15 Stefan Monnier * xfns.c (Fx_create_frame): internal-border-width default to 0 for Gtk. diff -r 42fbae40c9e0 -r fbdde312e09d src/font.c --- a/src/font.c Sun Jun 15 09:43:38 2008 +0000 +++ b/src/font.c Sun Jun 15 10:13:24 2008 +0000 @@ -3272,7 +3272,7 @@ if (! EQ (new_drivers, Qt)) { /* Re-order the driver list according to new_drivers. */ - struct font_driver_list **list_table, *list; + struct font_driver_list **list_table, **next; Lisp_Object tail; int i; @@ -3290,15 +3290,13 @@ list_table[i] = list; list_table[i] = NULL; - f->font_driver_list = list = NULL; + next = &f->font_driver_list; for (i = 0; list_table[i]; i++) { - if (list) - list->next = list_table[i], list = list->next; - else - f->font_driver_list = list = list_table[i]; + *next = list_table[i]; + next = &(*next)->next; } - list->next = NULL; + *next = NULL; } for (list = f->font_driver_list; list; list = list->next)