Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Fix use of width uninitialized in graphemestep


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

Follow-Ups:
Re: [PATCH] Fix use of width uninitialized in graphemestep"S. Gilles" <sgilles@xxxxxxxxxxxx>
References:
Re: [PATCH 2/2 v2] Implement graphemestepOri Bernstein <ori@xxxxxxxxxxxxxx>
[PATCH] Fix use of width uninitialized in graphemestep"S. Gilles" <sgilles@xxxxxxxxxxxx>