From 63861afac8004becc3907993cd16b59a5bca5195 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 30 Mar 2023 23:12:50 +0200 Subject: mbsrtowcs: Fix behaviour in the C locale. * m4/mbsrtowcs.m4 (gl_FUNC_MBSRTOWCS): Invoke gl_MBRTOWC_C_LOCALE. If mbrtowc is buggy in the C locale, override also mbsrtowcs. * modules/mbsrtowcs (Files): Add m4/mbrtowc.m4. * tests/test-mbsrtowcs.c (main): Add a test of the C locale, based on tests/test-mbrtowc.c. * tests/test-mbsrtowcs5.sh: New file, based on tests/test-mbrtowc5.sh. * modules/mbsrtowcs-tests (Files): Add it. (Makefile.am): Test it. * doc/posix-functions/mbsrtowcs.texi: Mention the C locale behaviour bug. --- doc/posix-functions/mbsrtowcs.texi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc') diff --git a/doc/posix-functions/mbsrtowcs.texi b/doc/posix-functions/mbsrtowcs.texi index f27ec0f616..28c450ddfb 100644 --- a/doc/posix-functions/mbsrtowcs.texi +++ b/doc/posix-functions/mbsrtowcs.texi @@ -15,6 +15,10 @@ Minix 3.1.8, HP-UX 11.00, IRIX 6.5, mingw. This function does not work on some platforms: HP-UX 11, Solaris 11 2010-11. @item +In the C or POSIX locales, this function can return @code{(size_t) -1} +and set @code{errno} to @code{EILSEQ}: +glibc 2.35. +@item This function does not work when the first argument is NULL on some platforms: mingw. @end itemize -- cgit v1.2.1