From 0d1f7c088768c2183274ad0903931c90eaed61f7 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 20 Jun 2000 11:23:13 +0000 Subject: [PATCH] (font_list): Handle the case that REGISTRY doesn't contain information about ENCODING. --- src/xfaces.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/xfaces.c b/src/xfaces.c index 6379b13855c..44f47b88e38 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -2470,12 +2470,19 @@ font_list (f, pattern, family, registry, fonts) registry_str = (NILP (registry) ? "*" : (char *) XSTRING (registry)->data); pattern_str = (char *) alloca (strlen (family_str) - + strlen (registry_str) - + 10); - if (index (family_str, '-')) - sprintf (pattern_str, "-%s-*-%s", family_str, registry_str); - else - sprintf (pattern_str, "-*-%s-*-%s", family_str, registry_str); + + strlen (registry_str) + + 10); + strcpy (pattern_str, index (family_str, '-') ? "-" : "-*-"); + strcat (pattern_str, family_str); + strcat (pattern_str, "-*-"); + strcat (pattern_str, registry_str); + if (!index (registry_str, '-')) + { + if (registry_str[strlen (registry_str) - 1] == '*') + strcat (pattern_str, "-*"); + else + strcat (pattern_str, "*-*"); + } } else pattern_str = (char *) XSTRING (pattern)->data; -- 2.39.2