]> git.eshelyaron.com Git - emacs.git/commitdiff
(x_list_fonts): Work-around for the case XGetAtomName
authorKenichi Handa <handa@m17n.org>
Tue, 25 Aug 1998 03:59:40 +0000 (03:59 +0000)
committerKenichi Handa <handa@m17n.org>
Tue, 25 Aug 1998 03:59:40 +0000 (03:59 +0000)
returns a null string.  This happens when dxpc 3.7 is being used.

src/xterm.c

index 43fb3d60b3a244df6982187aa0c7d886cc740ead..0e4072eba6f4b93f3a37ffaa5126d36afbc4f2d1 100644 (file)
@@ -6496,12 +6496,21 @@ x_list_fonts (f, pattern, size, maxnames)
              int len = strlen (name);
              char *tmp;
 
-             num_fonts = 1;
-             names = (char **) alloca (sizeof (char *));
-             /* Some systems only allow alloca assigned to a simple var.  */
-             tmp = (char *) alloca (len + 1);  names[0] = tmp;
-             bcopy (name, names[0], len + 1);
-             XFree (name);
+             /* If DXPC (a Differential X Protocol Compressor)
+                 Ver.3.7 is running, XGetAtomName will return null
+                 string.  We must avoid such a name.  */
+             if (len == 0)
+               try_XLoadQueryFont = 0;
+             else
+               {
+                 num_fonts = 1;
+                 names = (char **) alloca (sizeof (char *));
+                 /* Some systems only allow alloca assigned to a
+                     simple var.  */
+                 tmp = (char *) alloca (len + 1);  names[0] = tmp;
+                 bcopy (name, names[0], len + 1);
+                 XFree (name);
+               }
            }
          else
            try_XLoadQueryFont = 0;