summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2023-03-30 23:12:50 +0200
committerBruno Haible <bruno@clisp.org>2023-03-30 23:12:50 +0200
commit63861afac8004becc3907993cd16b59a5bca5195 (patch)
tree6247e3ab6379e50c0ab1aa83e8aae1d22c0dd5b6 /m4
parent1ab07af585358746e7fcc0176ab1716db31ca902 (diff)
downloadgnulib-63861afac8004becc3907993cd16b59a5bca5195.tar.gz
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.
Diffstat (limited to 'm4')
-rw-r--r--m4/mbsrtowcs.m49
1 files changed, 8 insertions, 1 deletions
diff --git a/m4/mbsrtowcs.m4 b/m4/mbsrtowcs.m4
index f95af621dd..4f2e88c5a0 100644
--- a/m4/mbsrtowcs.m4
+++ b/m4/mbsrtowcs.m4
@@ -1,4 +1,4 @@
-# mbsrtowcs.m4 serial 14
+# mbsrtowcs.m4 serial 15
dnl Copyright (C) 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -32,6 +32,13 @@ AC_DEFUN([gl_FUNC_MBSRTOWCS],
*yes) ;;
*) REPLACE_MBSRTOWCS=1 ;;
esac
+ if test $REPLACE_MBSRTOWCS = 0; then
+ gl_MBRTOWC_C_LOCALE
+ case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
+ *yes) ;;
+ *) REPLACE_MBSRTOWCS=1 ;;
+ esac
+ fi
fi
fi
])