diff options
author | Bruno Haible <bruno@clisp.org> | 2023-03-30 13:25:20 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2023-03-30 19:39:46 +0200 |
commit | 11fe27f76c63c14b6f88c815b656f3f72d37ea41 (patch) | |
tree | 8a4661c83efd2d544ff729373b33955d54054d47 /modules/btowc-tests | |
parent | 60745587a2e0073df7fe4cb1ec462f423c8f2bb2 (diff) | |
download | gnulib-11fe27f76c63c14b6f88c815b656f3f72d37ea41.tar.gz |
btowc: Fix behaviour in the C locale.
* lib/btowc.c: Include <string.h>
(btowc): Use mbrtowc instead of mbtowc when possible.
* m4/btowc.m4 (gl_FUNC_BTOWC): Test for the mingw bug in the C locale.
Invoke gl_MBRTOWC_C_LOCALE. If mbrtowc is buggy in the C locale,
override also btowc.
(gl_PREREQ_BTOWC): Test whether mbrtowc exists.
* modules/btowc (Files): Add m4/mbrtowc.m4.
(Depends-on): Add mbrtowc.
* tests/test-btowc.c (main): Add a test of the C locale, based on
tests/test-mbrtowc.c.
* tests/test-btowc3.sh: New file, based on tests/test-mbrtowc5.sh.
* modules/btowc-tests (Files): Add it.
(Makefile.am): Test it.
* doc/posix-functions/btowc.texi: Mention the two C locale behaviour
bugs and that they are worked around.
Diffstat (limited to 'modules/btowc-tests')
-rw-r--r-- | modules/btowc-tests | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/btowc-tests b/modules/btowc-tests index 6bd3258520..59d33eb00b 100644 --- a/modules/btowc-tests +++ b/modules/btowc-tests @@ -1,6 +1,7 @@ Files: tests/test-btowc1.sh tests/test-btowc2.sh +tests/test-btowc3.sh tests/test-btowc.c tests/signature.h tests/macros.h @@ -15,7 +16,7 @@ gt_LOCALE_FR gt_LOCALE_FR_UTF8 Makefile.am: -TESTS += test-btowc1.sh test-btowc2.sh +TESTS += test-btowc1.sh test-btowc2.sh test-btowc3.sh TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' check_PROGRAMS += test-btowc test_btowc_LDADD = $(LDADD) $(SETLOCALE_LIB) |