On 9/17/17 6:01 AM, Stephane Chazelas wrote:
> $ locale charmap
> UTF-8
> $ bash -c '"$@"' sh printf '%d\n' $'"\xff' $'"\xff' $'"\xff'
> 32767
> 0
> 0
> 
> That's because we store the return value of mblen() (which may be
> -1) into a size_t (unsigned) variable.
> 
> See patch below which aligns the behaviour with that of other
> shells which use the byte value when the initial sequence of
> bytes can't be converted to a character.

Thanks for the report. I'll take a look.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to