From 8906a5101bf62b719ddafa376fd4e0805e35617b Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 30 Mar 2023 23:15:52 +0200 Subject: mbsnrtowcs: Fix behaviour in the C locale. * m4/mbsnrtowcs.m4 (gl_FUNC_MBSNRTOWCS): Invoke gl_MBRTOWC_C_LOCALE. If mbrtowc is buggy in the C locale, override also mbsnrtowcs. * modules/mbsnrtowcs (Files): Add m4/mbrtowc.m4. * tests/test-mbsnrtowcs.c (main): Add a test of the C locale, based on tests/test-mbsrtowcs.c. * tests/test-mbsnrtowcs5.sh: New file, based on tests/test-mbrtowc5.sh. * modules/mbsnrtowcs-tests (Files): Add it. (Makefile.am): Test it. * doc/posix-functions/mbsnrtowcs.texi: Mention the C locale behaviour bug. --- doc/posix-functions/mbsnrtowcs.texi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc') diff --git a/doc/posix-functions/mbsnrtowcs.texi b/doc/posix-functions/mbsnrtowcs.texi index c6defd2c20..3a420c673a 100644 --- a/doc/posix-functions/mbsnrtowcs.texi +++ b/doc/posix-functions/mbsnrtowcs.texi @@ -14,6 +14,10 @@ FreeBSD 5.2.1, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, HP-UX 11, IRIX 6.5, Solaris @item This function produces invalid wide characters on some platforms: Solaris 11.4. +@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. @end itemize Portability problems not fixed by Gnulib: -- cgit v1.2.1