From ebd4b979c15691dbd0942d91eae8ad4094fff066 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sun, 20 May 2007 10:54:02 +0300 Subject: [PATCH] UTF-8, add_char_data: data can be UCS_NO_CHAR after all. --- src/terminal/screen.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/terminal/screen.c b/src/terminal/screen.c index aacfb893..6e94ff62 100644 --- a/src/terminal/screen.c +++ b/src/terminal/screen.c @@ -546,8 +546,8 @@ add_char_data(struct string *screen, struct screen_driver *driver, * defined 1 0 UTF-32 UTF-8 * defined 1 1 enum border_char UTF-8 * - * For "UTF-32" above, screen_char.data can also be UCS_NO_CHAR, - * but add_char_data() is not called in that case. + * For "UTF-32" above, data can also be UCS_NO_CHAR, + * in which case this function must not alter *screen. */ if (border && driver->opt.frame && data >= 176 && data < 224) @@ -561,6 +561,9 @@ add_char_data(struct string *screen, struct screen_driver *driver, add_to_string(screen, cp2utf8(charset, (unsigned char) data)); } else { + if (data == UCS_NO_CHAR) + return; + if (!isscreensafe_ucs(data)) data = UCS_SPACE; add_to_string(screen, encode_utf8(data));