[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix use of width uninitialized in graphemestep
- Subject: Re: [PATCH] Fix use of width uninitialized in graphemestep
- From: Ori Bernstein <ori@xxxxxxxxxxxxxx>
- Reply-to: myrddin-dev@xxxxxxxxxxxxxx
- Date: Mon, 6 Nov 2017 22:11:43 -0800
- To: myrddin-dev@xxxxxxxxxxxxxx
- Cc: "S. Gilles" <sgilles@xxxxxxxxxxxx>
On Tue, 7 Nov 2017 00:16:11 -0500, "S. Gilles" <sgilles@xxxxxxxxxxxx> wrote:
> This would result in infinite loops in pretty much any caller. Also
> fix handling of \r, \n, \t, which need to form their own graphemes,
> but which aren't nicely marked as positive width by cellwidth.
Well, that's another. The compiler shouldn't have let that pass.
> + if (c == '\r' || c == '\n' || c == '\t')
I did some reading[1], and it might be easier to do it the correct
way than we assumed. There's a table for this data[2].
[1] http://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries
[2] http://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakProperty.txt
I'm applying this because it fixes a fairly big bug, but it might
be nice to follow the spec here.
--
Ori Bernstein