From f0183c5730206e7dc5606d60596a150463c8da64 Mon Sep 17 00:00:00 2001 From: handa Date: Tue, 1 Jun 2004 01:21:10 +0000 Subject: [PATCH] (mfontset_modify_entry): Pay attention to the case that fontset->font_spec_list is NULL. --- src/fontset.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/fontset.c b/src/fontset.c index d42a44e..f525d68 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -837,14 +837,17 @@ mfontset_modify_entry (MFontset *fontset, if (fontset->mdb) load_fontset_contents (fontset); - MPLIST_DO (pl, fontset->font_spec_list) - { - if (! memcmp (MPLIST_VAL (pl), spec, sizeof (MFont))) - { - font = MPLIST_VAL (pl); - break; - } - } + if (! fontset->font_spec_list) + fontset->font_spec_list = mplist (); + else + MPLIST_DO (pl, fontset->font_spec_list) + { + if (! memcmp (MPLIST_VAL (pl), spec, sizeof (MFont))) + { + font = MPLIST_VAL (pl); + break; + } + } if (! font) { font = mfont (); -- 1.7.10.4