From 4313688a446fb34dd7d7ba53f63060819ff17efd Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 27 Oct 2014 13:31:04 +0000 Subject: Fix a regression in term.c rev. 1.229 reported by bentley@: In UTF-8 output, do not print anything if mchars_spec2cp() returns 0. In particular, this repairs handling of zero-width spaces (\&). While here, let mchars_spec2cp() return 0xFFFD instead of -1 if the character is not found, simplifying the using code. In HTML output, do not print obfuscated ASCII characters and do not test for one-char escapes, mchars_spec2cp() already does that. --- chars.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chars.c') diff --git a/chars.c b/chars.c index 950f9edc..6c217e43 100644 --- a/chars.c +++ b/chars.c @@ -104,7 +104,7 @@ mchars_spec2cp(const struct mchars *arg, const char *p, size_t sz) const struct ln *ln; ln = find(arg, p, sz); - return(ln != NULL ? ln->unicode : sz == 1 ? *p : -1); + return(ln != NULL ? ln->unicode : sz == 1 ? *p : 0xFFFD); } char -- cgit