]> git.eshelyaron.com Git - emacs.git/commitdiff
(font_update_drivers): Fix crash when no drivers match.
authorAndreas Schwab <schwab@suse.de>
Sun, 15 Jun 2008 10:13:24 +0000 (10:13 +0000)
committerAndreas Schwab <schwab@suse.de>
Sun, 15 Jun 2008 10:13:24 +0000 (10:13 +0000)
src/ChangeLog
src/font.c

index 8e24f83b15b5b465e38a4a5e198c0a439acbdf21..f3a7ec0468e8ef83d5a6ae52af4176ed94a6d3b9 100644 (file)
@@ -1,3 +1,7 @@
+2008-06-15  Andreas Schwab  <schwab@suse.de>
+
+       * font.c (font_update_drivers): Fix crash when no drivers match.
+
 2008-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * xfns.c (Fx_create_frame): internal-border-width default to 0 for Gtk.
index ead3a6a59a8f3b6e94b07523c718e0df1557d414..9667e031bcf578ebe1871d543df246090026249e 100644 (file)
@@ -3272,7 +3272,7 @@ font_update_drivers (f, new_drivers)
   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 @@ font_update_drivers (f, new_drivers)
          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)