fnmatch improvements

Brian Inglis Brian.Inglis@Shaw.ca
Thu Jul 27 20:25:29 GMT 2023


On 2023-07-27 13:05, Corinna Vinschen via Cygwin wrote:
> On Jul 27 20:24, Corinna Vinschen via Cygwin wrote:
>> On Jul 27 12:15, Bruno Haible via Cygwin wrote:
>> I'm looking into that.  First thing, your testsuite uncovered a bug in
>> the latest fnmatch in the C locale. Comparing pointers instead of
>> comparing characters was never a good idea for pattern matching...
>>
>> When I'm done I hope that our 3.5 fnmatch won't be overridden by the
>> gnulib version :}
>>
>>> I can't easily install a Cygwin 3.5.0 snapshot. If one of you would like to
>>> help, here's how to:
>>>    1. Create an environment for working with a Cygwin 3.5.0 snapshot (from
>>>       March 2023 or newer).
>>>    2. wget https://haible.de/bruno/gnu/testdir-fnmatch.tar.gz
>>>    3. tar xfz testdir-fnmatch.tar.gz
>>>    4. cd testdir-fnmatch-posix
>>>       ./configure 2>&1 | tee log1
>>>       make
>>>       make check
> 
> I fixed the above problem and the POSIX check now works fine:
> 
>>>       grep fnmatch log1
> 
>      checking for fnmatch.h... yes
>      checking for fnmatch... yes
>      checking for working POSIX fnmatch... yes
> 
> I also extraced the fnmatch configure testcase and ran it manually.
> It returns 0 now.  But:
> 
>>>       grep REPLACE_FNMATCH config.status
> 
>      S["REPLACE_FNMATCH"]="1"
> 
> Looks like the reason is that we don't have a uchar.h file?  Seems
> like this is of interest for AIX, but why should this be of
> interest for fnmatch on other systems?

It was added in C99 TR19769, integrated in C/++11, available in libicu-devel:

	https://cplusplus.com/reference/cuchar/

	https://open-std.org/jtc1/sc22/open/n3579.pdf

	https://open-std.org/jtc1/sc22/wg14/www/docs/n1326.pdf

	https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf#page=416

	$ find /usr/include/ -name uchar.h
	/usr/include/unicode/uchar.h

	$ cygcheck -f /usr/include/unicode/uchar.h
	libicu-devel-72.1-1

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry


More information about the Cygwin mailing list