From f30efd0201bd872d6fb081f0c6422001f06d5116 Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Sat, 7 Apr 2018 17:01:11 +0430 Subject: [PATCH] trfn: disallow glyphs with any white-space characters in their names Reported by Pierre-Jean . --- trfn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trfn.c b/trfn.c index 767bc8e..1416ca2 100644 --- a/trfn.c +++ b/trfn.c @@ -285,8 +285,8 @@ void trfn_char(char *psname, int n, int u, int wid, if (!trfn_swid && (!strcmp(" ", uc) || !strcmp(" ", uc))) trfn_swid = WX(wid); /* printing troff charset */ - if (strchr(uc, ' ')) /* space not allowed in char names */ - strcpy(uc, "---"); + if (isspace((unsigned char) uc[0]) || strchr(uc, ' ')) + strcpy(uc, "---"); /* space not allowed in char names */ if (strcmp("---", uc)) trfn_lig(uc); sbuf_printf(sbuf_char, "char %s\t%d", uc, WX(wid)); -- 2.11.4.GIT