Commit e1bf05c1 authored by Kenichi Handa's avatar Kenichi Handa
Browse files

font.c (font_unparse_xlfd): Exclude special characters from the generating XLFD name.

parent 8e6a67b7
2012-11-13 Kenichi Handa <handa@gnu.org>
* font.c (font_unparse_xlfd): Exclude special characters from the
generating XLFD name.
2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
 
* window.c (quad): New function.
......
......@@ -1185,7 +1185,7 @@ ptrdiff_t
font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
{
char *p;
const char *f[XLFD_REGISTRY_INDEX + 1];
char *f[XLFD_REGISTRY_INDEX + 1];
Lisp_Object val;
int i, j, len;
......@@ -1234,8 +1234,21 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
f[j] = "*";
else
{
int c, k, l;
ptrdiff_t alloc;
val = SYMBOL_NAME (val);
f[j] = SSDATA (val);
alloc = SBYTES (val) + 1;
if (nbytes <= alloc)
return -1;
f[j] = alloca (alloc);
/* Copy the name while excluding '-', '?', ',', and '"'. */
for (k = l = 0; k < alloc; k++)
{
c = SREF (val, k);
if (c != '-' && c != '?' && c != ',' && c != '"')
f[j][l++] = c;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment