From 54a043ffd13f3d896b58c6a9f0a4a5bb2170b9ab Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 21:38:58 +0200 Subject: Merging upstream version 2.12.1. Signed-off-by: Daniel Baumann --- gl/m4/fnmatch.m4 | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'gl/m4/fnmatch.m4') diff --git a/gl/m4/fnmatch.m4 b/gl/m4/fnmatch.m4 index eba70de..54d5c7b 100644 --- a/gl/m4/fnmatch.m4 +++ b/gl/m4/fnmatch.m4 @@ -1,6 +1,6 @@ -# Check for fnmatch - serial 17 -*- coding: utf-8 -*- +# Check for fnmatch - serial 20 -*- coding: utf-8 -*- -# Copyright (C) 2000-2007, 2009-2023 Free Software Foundation, Inc. +# Copyright (C) 2000-2007, 2009-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,7 +14,7 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX], m4_divert_text([DEFAULTS], [gl_fnmatch_required=POSIX]) AC_REQUIRE([gl_FNMATCH_H]) - AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([AC_CANONICAL_HOST]) gl_fnmatch_required_lowercase=` echo $gl_fnmatch_required | LC_ALL=C tr '[[A-Z]]' '[[a-z]]' ` @@ -108,6 +108,17 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX], exists in glibc 2.12, fixed in glibc 2.13. */ if (!y ("[/b", "[/b", 0)) /*"]]"*/ result |= 4; + /* glibc bug + is fixed in glibc 2.20. + glibc bugs + + are fixed in glibc 2.22. + These bugs are not easy to test for reliably (without mmap), + therefore test the glibc version. */ + #if defined __GLIBC__ + if (__GLIBC__ == 2 && __GLIBC_MINOR__ < 22) + result |= 4; + #endif /* This test fails on FreeBSD 13.2, NetBSD 9.3, Cygwin 3.4.6. */ if (!y ("[[:alnum:]]", "a", 0)) result |= 8; @@ -158,6 +169,24 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX], *yes) ;; *) REPLACE_FNMATCH=1 ;; esac + dnl On AIX 7.2 in 32-bit mode, fnmatch()'s only POSIX compliance problem is + dnl that is does not support characters outside the Unicode BMP correctly. + dnl Test case: fnmatch ("x?y", "x\360\237\230\213y", 0) == 0 + dnl This is due to wchar_t being only 16 bits wide. + AC_REQUIRE([gl_UCHAR_H]) + if test $SMALL_WCHAR_T = 1; then + case "$host_os" in + cygwin*) + dnl On Cygwin < 3.5.0, the above $gl_fnmatch_result came out as 'no', + dnl On Cygwin >= 3.5.0, fnmatch supports all Unicode characters, + dnl despite wchar_t being only 16 bits wide (because internally it + dnl works on wint_t values). + ;; + *) + REPLACE_FNMATCH=1 + ;; + esac + fi fi if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then gl_REPLACE_FNMATCH_H -- cgit v1.2.3