From 62260b0f2f1ac2352e821e41c1f826a710a5b4c7 Mon Sep 17 00:00:00 2001 From: handa Date: Tue, 12 Oct 2004 00:23:10 +0000 Subject: [PATCH] (mfont_list): If no font is found, return NULL. --- src/font.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/font.c b/src/font.c index 64175e9..6b04037 100644 --- a/src/font.c +++ b/src/font.c @@ -2107,7 +2107,8 @@ mfont_resize_ratio (MFont *font) @return This function returns a plist whose keys are family names and values are pointers to the object MFont. The plist must be freed - by m17n_object_unref (). */ + by m17n_object_unref (). If no font is found, it returns + NULL. */ MPlist * mfont_list (MFrame *frame, MFont *font, MSymbol language, int maxnum) @@ -2124,6 +2125,11 @@ mfont_list (MFrame *frame, MFont *font, MSymbol language, int maxnum) if (maxnum > 0 && num >= maxnum) break; } + if (MPLIST_TAIL_P (plist)) + { + M17N_OBJECT_UNREF (plist); + plist = NULL; + } return plist; } -- 1.7.10.4