aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1993-06-11 07:14:12 +0000
committerRichard M. Stallman <[email protected]>1993-06-11 07:14:12 +0000
commita91073601176d732ed0104d9488da2b84bc82004 (patch)
tree1c924f6b7eaad2ce21b6167e4d37a77cc4da1b87 /src
parent0c94f6ee88cf57affcdb5e45b603bb39a1b7f7ff (diff)
(Fx_list_fonts): If names is 0, just return nil.
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/xfns.c b/src/xfns.c
index e46053ba16..1ca40679e3 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -2227,22 +2227,24 @@ fonts), even if they match PATTERN and FACE.")
&info); /* info_return */
UNBLOCK_INPUT;
- {
- Lisp_Object *tail;
- int i;
+ list = Qnil;
- 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;
- }
+ if (names)
+ {
+ Lisp_Object *tail;
+ int i;
- XFreeFontInfo (names, info, num_fonts);
- }
+ 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;
}