From ebb9aa922a01d5052acee38d06d4b175086ba725 Mon Sep 17 00:00:00 2001 From: handa Date: Fri, 19 Aug 2005 02:06:24 +0000 Subject: [PATCH] (mfont_list): If FONT is null, use a temporary font. --- src/font.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/font.c b/src/font.c index 22aa0e9..4cecfbd 100644 --- a/src/font.c +++ b/src/font.c @@ -2666,6 +2666,7 @@ mfont_list (MFrame *frame, MFont *font, MSymbol language, int maxnum) MPlist *plist, *pl; MFontList *font_list; int i; + MFont *work = NULL; if (language != Mnil) { @@ -2673,10 +2674,14 @@ mfont_list (MFrame *frame, MFont *font, MSymbol language, int maxnum) char *buf = alloca (MSYMBOL_NAMELEN (language) + 7); sprintf (buf, ":lang=%s", MSYMBOL_NAME (language)); + if (! font) + font = work = mfont (); font->capability = msymbol (buf); } font_list = mfont__list (frame, font, font, 0); + if (work) + free (work); if (! font_list) return NULL; if (font_list->nfonts == 0) -- 1.7.10.4