aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-10-28 18:49:33 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-10-28 18:49:33 +0000
commit3e8d538cdcbed1408b260186b980e5fa4eeb81af (patch)
tree5db1d6f486a01ff0daff2839dc0b8eb76b4f163a /term.c
parentd0ac87d04f62f2c8e644686b707cb2602c2ddba6 (diff)
downloadmandoc-3e8d538cdcbed1408b260186b980e5fa4eeb81af.tar.gz
mandoc-3e8d538cdcbed1408b260186b980e5fa4eeb81af.tar.zst
mandoc-3e8d538cdcbed1408b260186b980e5fa4eeb81af.zip
In -Tascii mode, print "<?>" only for Unicode escapes of unknown
representation, not for character escapes with unknown names. According to groff, the latter produce no output, and we now warn about them.
Diffstat (limited to 'term.c')
-rw-r--r--term.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/term.c b/term.c
index b1e50255..6cac5ab5 100644
--- a/term.c
+++ b/term.c
@@ -1,4 +1,4 @@
-/* $Id: term.c,v 1.231 2014/10/28 17:36:19 schwarze Exp $ */
+/* $Id: term.c,v 1.232 2014/10/28 18:49:33 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -458,9 +458,7 @@ term_word(struct termp *p, const char *word)
if (p->enc == TERMENC_ASCII) {
cp = mchars_spec2str(p->symtab,
seq, sz, &ssz);
- if (cp == NULL)
- encode(p, "<?>", 3);
- else
+ if (cp != NULL)
encode(p, cp, ssz);
} else {
uc = mchars_spec2cp(p->symtab, seq, sz);
@@ -690,14 +688,10 @@ term_strlen(const struct termp *p, const char *cp)
sz += cond_width(p, c, &skip);
break;
case ESCAPE_SPECIAL:
- if (p->enc == TERMENC_ASCII) {
+ if (p->enc == TERMENC_ASCII)
rhs = mchars_spec2str(p->symtab,
seq, ssz, &rsz);
- if (rhs == NULL) {
- rhs = "<?>";
- rsz = 3;
- }
- } else {
+ else {
c = mchars_spec2cp(p->symtab,
seq, ssz);
if (c > 0)