comparison src/xterm.c @ 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 88fadff500be
children 44eda932afcf
comparison
equal deleted inserted replaced
23094:7099472e122b 23095:4e83e072cd97
6494 { 6494 {
6495 char *name = (char *) XGetAtomName (dpy, (Atom) value); 6495 char *name = (char *) XGetAtomName (dpy, (Atom) value);
6496 int len = strlen (name); 6496 int len = strlen (name);
6497 char *tmp; 6497 char *tmp;
6498 6498
6499 num_fonts = 1; 6499 /* If DXPC (a Differential X Protocol Compressor)
6500 names = (char **) alloca (sizeof (char *)); 6500 Ver.3.7 is running, XGetAtomName will return null
6501 /* Some systems only allow alloca assigned to a simple var. */ 6501 string. We must avoid such a name. */
6502 tmp = (char *) alloca (len + 1); names[0] = tmp; 6502 if (len == 0)
6503 bcopy (name, names[0], len + 1); 6503 try_XLoadQueryFont = 0;
6504 XFree (name); 6504 else
6505 {
6506 num_fonts = 1;
6507 names = (char **) alloca (sizeof (char *));
6508 /* Some systems only allow alloca assigned to a
6509 simple var. */
6510 tmp = (char *) alloca (len + 1); names[0] = tmp;
6511 bcopy (name, names[0], len + 1);
6512 XFree (name);
6513 }
6505 } 6514 }
6506 else 6515 else
6507 try_XLoadQueryFont = 0; 6516 try_XLoadQueryFont = 0;
6508 6517
6509 if (font) 6518 if (font)