summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2023-03-30 23:15:52 +0200
committerBruno Haible <bruno@clisp.org>2023-03-30 23:15:52 +0200
commit8906a5101bf62b719ddafa376fd4e0805e35617b (patch)
tree5b48fc73a03cb708b948c700329da2b739ed3c45 /m4
parent63861afac8004becc3907993cd16b59a5bca5195 (diff)
downloadgnulib-8906a5101bf62b719ddafa376fd4e0805e35617b.tar.gz
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.
Diffstat (limited to 'm4')
-rw-r--r--m4/mbsnrtowcs.m49
1 files changed, 8 insertions, 1 deletions
diff --git a/m4/mbsnrtowcs.m4 b/m4/mbsnrtowcs.m4
index 34dcf30e63..7cab5f79ed 100644
--- a/m4/mbsnrtowcs.m4
+++ b/m4/mbsnrtowcs.m4
@@ -1,4 +1,4 @@
-# mbsnrtowcs.m4 serial 8
+# mbsnrtowcs.m4 serial 9
dnl Copyright (C) 2008, 2010-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,
@@ -29,6 +29,13 @@ AC_DEFUN([gl_FUNC_MBSNRTOWCS],
*yes) ;;
*) REPLACE_MBSNRTOWCS=1 ;;
esac
+ if test $REPLACE_MBSNRTOWCS = 0; then
+ gl_MBRTOWC_C_LOCALE
+ case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
+ *yes) ;;
+ *) REPLACE_MBSNRTOWCS=1 ;;
+ esac
+ fi
fi
fi
])