[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [screen-devel] [bug #60030] Screen segfaults by displaying some UTF-
From: |
Michael Schroeder |
Subject: |
Re: [screen-devel] [bug #60030] Screen segfaults by displaying some UTF-8 character combination |
Date: |
Fri, 12 Feb 2021 10:14:34 +0000 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Thu, Feb 11, 2021 at 11:39:09PM +0100, Axel Beckert wrote:
> The only thing it didn't fix so far is
> https://savannah.gnu.org/bugs/?31336 aka
> https://bugs.debian.org/600246 although I really had some hope that
> this might be fixed as a side-effect of your patch. :-)
Oh, that happens because the U+3099 combining char is also matched
in utf8_isdouble(). The code in ansi.c does not expect this. Thus
this is another fallout from that commit. ;)
A simple fix (other than removing the entries from the isdouble
table) is to move the curr->w_mbcs = 0xff setting after the
combining character handling:
diff --git a/ansi.c b/ansi.c
index 2a52edd..83b266d 100644
--- a/ansi.c
+++ b/ansi.c
@@ -692,10 +692,6 @@ register int len;
}
curr->w_rend.font = 0;
}
-# ifdef DW_CHARS
- if (curr->w_encoding == UTF8 && utf8_isdouble(c))
- curr->w_mbcs = 0xff;
-# endif
if (curr->w_encoding == UTF8 && c >= 0x0300 && utf8_iscomb(c))
{
int ox, oy;
@@ -730,6 +726,10 @@ register int len;
}
break;
}
+# ifdef DW_CHARS
+ if (curr->w_encoding == UTF8 && utf8_isdouble(c))
+ curr->w_mbcs = 0xff;
+# endif
font = curr->w_rend.font;
# endif
# ifdef DW_CHARS
Cheers,
Michael.
--
Michael Schroeder SUSE Software Solutions Germany GmbH
mls@suse.de GF: Felix Imendoerffer HRB 36809, AG Nuernberg
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}
- [screen-devel] [bug #60030] Screen segfaults by displaying some UTF-8 character combination, (continued)
- [screen-devel] [bug #60030] Screen segfaults by displaying some UTF-8 character combination, Michael Schröder, 2021/02/10
- Re: [screen-devel] [bug #60030] Screen segfaults by displaying some UTF-8 character combination, Michael Schroeder, 2021/02/11
- Re: [screen-devel] [bug #60030] Screen segfaults by displaying some UTF-8 character combination, Axel Beckert, 2021/02/11
- Re: [screen-devel] [bug #60030] Screen segfaults by displaying some UTF-8 character combination, Michael Schroeder, 2021/02/11
- Re: [screen-devel] [bug #60030] Screen segfaults by displaying some UTF-8 character combination, Axel Beckert, 2021/02/11
- Re: [screen-devel] [bug #60030] Screen segfaults by displaying some UTF-8 character combination,
Michael Schroeder <=
- Re: [screen-devel] [bug #60030] Screen segfaults by displaying some UTF-8 character combination, Axel Beckert, 2021/02/12