From 6f6512e8c06e0e4353a9bd33be5f71feaa1b5dd0 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 25 Aug 1998 03:59:40 +0000 Subject: [PATCH] (x_list_fonts): Work-around for the case XGetAtomName returns a null string. This happens when dxpc 3.7 is being used. --- src/xterm.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 43fb3d60b3a..0e4072eba6f 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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; -- 2.39.2