On Wed, 17 Dec 2014 09:46:09 -0800
Paul Eggert <[email protected]> wrote:
> Yes, and that's the point: we don't want this if-statement to be pruned
> if WCP != NULL. We want the code to return P right away in the typical
> case where P is at a character boundary. If MBP is way less than P,
> this will save the work of the following loop.
We must set a wide character for not next but previous character to WCP
in a case to return P.
For example, I assume following sequence in Shift_JIS locale. A pair of
0x95 0x5c is a multibyte character in Shift_JIS locale. I assume to
input MBP = position (a) and P = position (d) into skip_remains_mb().
0x41 0x95 0x5c 0x0a
(a) (b) (c) (d)
If WCP == NULL, we can return P right away. On the other hands, if
WCP != NULL, we must set a wide character for 0x95 0x5c to WCP before
return P.
Do you have any ideas to utilize always_character_boundary for the case?