Re: [PATCH] mbrlen, mbrtowc: fix bug with empty input

2014-05-18 Thread Pádraig Brady
On 05/17/2014 01:23 AM, Paul Eggert wrote: > Pádraig Brady wrote: >> To me, mbrtowc returning 0 for empty input is not surprising. >> Also POSIX says for mbr{len,towc} that they shall return 0 >> "If the next n or fewer bytes complete the character that corresponds to the >> null wide character >

Re: [PATCH] mbrlen, mbrtowc: fix bug with empty input

2014-05-16 Thread Paul Eggert
Pádraig Brady wrote: To me, mbrtowc returning 0 for empty input is not surprising. Also POSIX says for mbr{len,towc} that they shall return 0 "If the next n or fewer bytes complete the character that corresponds to the null wide character At least 1 byte is needed to represent a null wide char

Re: [PATCH] mbrlen, mbrtowc: fix bug with empty input

2014-05-16 Thread Jim Meyering
On Fri, May 16, 2014 at 1:56 PM, Paul Eggert wrote: > +*) AC_DEFINE([MBRTOWC_EMPTY_INPUT_BUG], [1], > + [Define if the mbrtowc function does not return (size_t) 2 Thanks. I've fixed that typo: s/2/-2/ 0001-mbrtowc.m4-fix-a-comment-typo.patch Description: Binary data

Re: [PATCH] mbrlen, mbrtowc: fix bug with empty input

2014-05-16 Thread Pádraig Brady
General question. To me, mbrtowc returning 0 for empty input is not surprising. Also POSIX says for mbr{len,towc} that they shall return 0 "If the next n or fewer bytes complete the character that corresponds to the null wide character" What am I missing? Pádraig. p.s. there is a small "(size_t