aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/term_ascii.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_ascii.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_ascii.c')
-rw-r--r--term_ascii.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/term_ascii.c b/term_ascii.c
index 6ec27be0..6c290453 100644
--- a/term_ascii.c
+++ b/term_ascii.c
@@ -1,4 +1,4 @@
-/* $Id: term_ascii.c,v 1.38 2014/10/28 17:36:19 schwarze Exp $ */
+/* $Id: term_ascii.c,v 1.39 2014/10/28 18:49:33 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -19,6 +19,7 @@
#include <sys/types.h>
+#include <assert.h>
#if HAVE_WCHAR
#include <locale.h>
#endif
@@ -337,8 +338,7 @@ ascii_uc2str(int uc)
"j", "DZ", "Dz", "dz", "'\bG", "'\bg", "HV", "W",
"`\bN", "`\bn", "A", "a", "'\bAE","'\bae","O", "o"};
- if (uc < 0)
- return("<?>");
+ assert(uc >= 0);
if ((size_t)uc < sizeof(tab)/sizeof(tab[0]))
return(tab[uc]);
return(mchars_uc2str(uc));