changeset 3640:df1a2751ca24

(Fx_list_fonts): If names is 0, just return nil.
author Richard M. Stallman <rms@gnu.org>
date Fri, 11 Jun 1993 07:14:12 +0000
parents 70a688f0cdae
children a846352be1a0
files src/xfns.c
diffstat 1 files changed, 18 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Fri Jun 11 07:02:36 1993 +0000
+++ b/src/xfns.c	Fri Jun 11 07:14:12 1993 +0000
@@ -2227,22 +2227,24 @@
 			      &info); /* info_return */
   UNBLOCK_INPUT;
 
-  {
-    Lisp_Object *tail;
-    int i;
-
-    list = Qnil;
-    tail = &list;
-    for (i = 0; i < num_fonts; i++)
-      if (! size_ref 
-	  || same_size_fonts (&info[i], size_ref))
-	{
-	  *tail = Fcons (build_string (names[i]), Qnil);
-	  tail = &XCONS (*tail)->cdr;
-	}
-
-    XFreeFontInfo (names, info, num_fonts);
-  }
+  list = Qnil;
+
+  if (names)
+    {
+      Lisp_Object *tail;
+      int i;
+
+      tail = &list;
+      for (i = 0; i < num_fonts; i++)
+	if (! size_ref 
+	    || same_size_fonts (&info[i], size_ref))
+	  {
+	    *tail = Fcons (build_string (names[i]), Qnil);
+	    tail = &XCONS (*tail)->cdr;
+	  }
+
+      XFreeFontInfo (names, info, num_fonts);
+    }
 
   return list;
 }