changeset 29768:6f3f0ca4a359

(font_list): Handle the case that REGISTRY doesn't contain information about ENCODING.
author Kenichi Handa <handa@m17n.org>
date Tue, 20 Jun 2000 11:23:13 +0000
parents c8e5453dc85d
children 18a16ab69699
files src/xfaces.c
diffstat 1 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfaces.c	Tue Jun 20 11:22:32 2000 +0000
+++ b/src/xfaces.c	Tue Jun 20 11:23:13 2000 +0000
@@ -2470,12 +2470,19 @@
       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;