changeset 73568:0cc0a8049941

(xic_create_xfontset): Fix previous change.
author Kenichi Handa <handa@m17n.org>
date Tue, 31 Oct 2006 06:41:55 +0000
parents 14e412e445c1
children 7c88de81d0f5
files src/xfns.c
diffstat 1 files changed, 26 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Tue Oct 31 02:08:16 2006 +0000
+++ b/src/xfns.c	Tue Oct 31 06:41:55 2006 +0000
@@ -2134,27 +2134,35 @@
   if (!xfs)
     {
       char *fontsetname = xic_create_fontsetname (base_fontname, False);
-      char *p0 = fontsetname, *p1;
 
       /* New fontset.  */
-      /* FONTSETNAME contains a list of font names (specific fonts
-	 first, general fonts last), but giving that to XCreateFontSet
-	 at once occasionally fails (bug of X?).  So, we try to call
-	 XCreateFontSet for each fontname.  */
-
-      while (p0)
+      xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
+			    fontsetname, &missing_list,
+			    &missing_count, &def_string);
+      if (missing_list)
+	XFreeStringList (missing_list);
+      if (! xfs)
 	{
-	  p1 = strchr (p0, ',');
-	  if (p1)
-	    *p1 = '\0';
-	  xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
-				p0, &missing_list,
-				&missing_count, &def_string);
-	  if (missing_list)
-	    XFreeStringList (missing_list);
-	  if (xfs)
-	    break;
-	  p0 = p1 ? p1 + 1 : NULL;
+	  /* FONTSETNAME contains a list of font names (specific fonts
+	     first, general fonts last), but giving that to
+	     XCreateFontSet at once occasionally fails (bug of X?).
+	     So, we try to call XCreateFontSet for each fontname.  */
+	  char *p0 = fontsetname, *p1;
+
+	  while (p0)
+	    {
+	      p1 = strchr (p0, ',');
+	      if (p1)
+		*p1 = '\0';
+	      xfs = XCreateFontSet (FRAME_X_DISPLAY (f),
+				    p0, &missing_list,
+				    &missing_count, &def_string);
+	      if (missing_list)
+		XFreeStringList (missing_list);
+	      if (xfs)
+		break;
+	      p0 = p1 ? p1 + 1 : NULL;
+	    }
 	}
       xfree (fontsetname);
     }