changeset 23095:4e83e072cd97

(x_list_fonts): Work-around for the case XGetAtomName returns a null string. This happens when dxpc 3.7 is being used.
author Kenichi Handa <handa@m17n.org>
date Tue, 25 Aug 1998 03:59:40 +0000
parents 7099472e122b
children e4419c63d4d7
files src/xterm.c
diffstat 1 files changed, 15 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Mon Aug 24 10:21:51 1998 +0000
+++ b/src/xterm.c	Tue Aug 25 03:59:40 1998 +0000
@@ -6496,12 +6496,21 @@
 	      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;