mirror of
https://git.savannah.gnu.org/git/gnulib.git
synced 2025-08-14 14:01:48 +03:00
Fix mbrtowc so that it never returns -1 in the C locale, as this conflicts with a future version of POSIX http://austingroupbugs.net/view.php?id=663#c2738 and causes problems with GNU grep: http://bugs.gnu.org/23234 See glibc bug 19932: https://sourceware.org/bugzilla/show_bug.cgi?id=19932 * doc/posix-functions/mbrlen.texi (mbrlen): * doc/posix-functions/mbrtowc.texi (mbrtowc): Document the glibc bug. * lib/mbrtowc.c [C_LOCALE_MAYBE_EILSEQ]: Include hard-locale.h, locale.h. (rpl_mbrtowc): Work around the C_LOCALE_MAYBE_EILSEQ bug, if the bug is possible. * m4/mbrtowc.m4 (gl_MBRTOWC_C_LOCALE): New macro. (gl_FUNC_MBRTOWC): Use it, and define C_LOCALE_MAYBE_EILSEQ as needed. * modules/hard-locale (License): Now LGPLv2+, for mbrtowc. * modules/mbrtowc (Depends-on): Add hard-locale. * modules/mbrtowc-tests (Files, TESTS): Add tests/test-mbrtowc5.sh. * tests/test-mbrtowc.c (main): Test for bug fix if arg is '5'. * tests/test-mbrtowc5.sh: New file.
40 lines
818 B
Plaintext
40 lines
818 B
Plaintext
Description:
|
|
mbrtowc() function: convert multibyte character to wide character.
|
|
|
|
Files:
|
|
lib/mbrtowc.c
|
|
m4/mbrtowc.m4
|
|
m4/mbstate_t.m4
|
|
m4/locale-fr.m4
|
|
m4/locale-ja.m4
|
|
m4/locale-zh.m4
|
|
m4/codeset.m4
|
|
|
|
Depends-on:
|
|
wchar
|
|
extensions
|
|
hard-locale [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
|
|
mbsinit [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
|
|
localcharset [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
|
|
streq [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
|
|
verify [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
|
|
|
|
configure.ac:
|
|
gl_FUNC_MBRTOWC
|
|
if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
|
|
AC_LIBOBJ([mbrtowc])
|
|
gl_PREREQ_MBRTOWC
|
|
fi
|
|
gl_WCHAR_MODULE_INDICATOR([mbrtowc])
|
|
|
|
Makefile.am:
|
|
|
|
Include:
|
|
<wchar.h>
|
|
|
|
License:
|
|
LGPLv2+
|
|
|
|
Maintainer:
|
|
all
|