ref: f30efd0201bd872d6fb081f0c6422001f06d5116
parent: a0d4d750283d557f0dfed42b0a03486b3a5ec792
author: Ali Gholami Rudi <ali@rudi.ir>
date: Sat Apr 7 13:01:11 EDT 2018
trfn: disallow glyphs with any white-space characters in their names Reported by Pierre-Jean <lists@utroff.org>.
--- a/trfn.c
+++ b/trfn.c
@@ -285,8 +285,8 @@
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));