From: handa Date: Tue, 12 Oct 2004 00:23:10 +0000 (+0000) Subject: (mfont_list): If no font is found, return NULL. X-Git-Tag: REL-1-2-0~133 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=62260b0f2f1ac2352e821e41c1f826a710a5b4c7;p=m17n%2Fm17n-lib.git (mfont_list): If no font is found, return NULL. --- 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; }