adding gnulib, as m4 merely borrows the content from gnulib.
On 05/16/2014 09:52 AM, Santiago Vila wrote:
> Hello.
>
> I received the following report from the Debian bug system.
> [ Please keep the Cc: lines when replying. Thanks ].
>
> - Forwarded message from Erwan Prioul -
>
> Date
On Thu, May 15, 2014 at 6:30 PM, Paul Eggert wrote:
> * doc/posix-functions/mbrlen.texi (mbrlen):
> * doc/posix-functions/mbrtowc.texi (mbrtowc):
> Document portability problem when the input string is empty. See:
> https://sourceware.org/bugzilla/show_bug.cgi?id=16950
> ChangeLog
On 05/16/2014 11:13 AM, Jim Meyering wrote:
Thanks for tracking that down. This sounds like it will deserve
compile/run tests so that gnulib-using projects will detect the bug
and use the replacement functions.
Thanks, good idea.
gnulib/tests/test-mbrtowc.c has test cases for zero-length inp
* lib/mbrtowc.c (rpl_mbrtowc) [MBRTOWC_EMPTY_INPUT_BUG]: Fix the bug.
* m4/mbrlen.m4 (gl_MBRLEN_EMPTY_INPUT): New macro. It's not used,
so this is mainly for documentation.
* m4/mbrtowc.m4 (gl_MBRTOWC_EMPTY_INPUT): New macro.
(gl_FUNC_MBRTOWC): Use it.
* tests/test-mbrtowc.c (main): Test for the b
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
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
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