<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/win32/fnmatch.c, branch zstd</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=zstd</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=zstd'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2022-06-23T15:05:17+00:00</updated>
<entry>
<title>win32: bug fix in fnmatch(3)</title>
<updated>2022-06-23T15:05:17+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2022-06-23T15:05:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=6c19fb9008e2dcd7a2d4ce42f618ec2079b1230f'/>
<id>urn:sha1:6c19fb9008e2dcd7a2d4ce42f618ec2079b1230f</id>
<content type='text'>
A user reports:

   Here is the shell script that causes me problems:

   var=foo:bar
   echo ${var#*[[:space:]]}

   What expect I to see echoed is foo:bar, however what I see
   bar.  It seems that the [[:space:]] character class is matching
   the colon character in addition to whitespace characters.  I
   see the same problem with the [[:blank:]] character class.

This is due to a bug in the WIN32 implementation of fnmatch(3)
which is derived from an old snapshot of glibc code (glibc commit
7814856974 from 1999-09-12).  The bug was fixed in glibc by commit
83b1b6d8fa of 2000-07-04.

Apply the equivalent fix to our version.
</content>
</entry>
<entry>
<title>win32: code shrink character class detection</title>
<updated>2021-08-09T13:58:37+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-08-09T13:58:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=56e1d04ae71a05586fa3414aabdef0de720d0720'/>
<id>urn:sha1:56e1d04ae71a05586fa3414aabdef0de720d0720</id>
<content type='text'>
Add a routine to detect the names of character classes.  Use it
in fnmatch(3) and regcomp(3), replacing local code in the former.

Saves 216 bytes.
</content>
</entry>
<entry>
<title>win32: fix fnmatch(3) handling of xdigit</title>
<updated>2021-08-09T13:41:48+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-08-09T13:41:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=dd10dfda5834b0e67ebab0425d0a48fbfc939d7f'/>
<id>urn:sha1:dd10dfda5834b0e67ebab0425d0a48fbfc939d7f</id>
<content type='text'>
The glob pattern '[[:xdigit::]]*' didn't return the matches
expected.  It turns out the implementation (from glibc) fails
to detect 'xdigit' as a valid character class.  Changing the
definition of CHAR_CLASS_MAX_LENGTH to 7 fixes the problem.

This was never an issue in glibc because it uses a different
definition.  More modern versions of fnmatch(3) in glibc and
gnulib also make CHAR_CLASS_MAX_LENGTH long enough.

The code for fnmatch(3) was taken from glibc at commit
7814856974388a856a575fa45f88d502c8a1ab29.  This was the last
version before the code was rearraged to better support multibyte
characters.
</content>
</entry>
<entry>
<title>win32: save bytes in fnmatch</title>
<updated>2020-02-16T09:56:04+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2020-02-16T09:56:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=5f6aaf23076dd0f523eccf821987276cc36080ae'/>
<id>urn:sha1:5f6aaf23076dd0f523eccf821987276cc36080ae</id>
<content type='text'>
Replace several explicit string comparisons with a single call
to index_in_strings().

Saves 304 bytes.
</content>
</entry>
<entry>
<title>win32: use strchrnul from BusyBox in fnmatch</title>
<updated>2018-03-05T14:33:51+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2018-03-05T14:33:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=ce1d1546e17a5f613aad2bdf327a1abb77a32bdb'/>
<id>urn:sha1:ce1d1546e17a5f613aad2bdf327a1abb77a32bdb</id>
<content type='text'>
BusyBox ensures that strchrnul is always available, either from the
target platform or by including its own version.  Therefore it isn't
necessary for fnmatch to use its equivalent.
</content>
</entry>
<entry>
<title>win32/fnmatch: fix old-style function declaration</title>
<updated>2017-08-23T11:56:21+00:00</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2017-06-27T22:16:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=0f9b26911deb86f03934c081eb4ae49f1de29243'/>
<id>urn:sha1:0f9b26911deb86f03934c081eb4ae49f1de29243</id>
<content type='text'>
It would be more straight-forward to simply #include "libbb.h" which
includes a #define getenv mingw_getenv, but that header also defines
isprint() to a function that is nowhere to be found, leading to link
problems.

So let's go the easy route.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Ron Yorston &lt;rmy@pobox.com&gt;
</content>
</entry>
<entry>
<title>win32/fnmatch: avoid old-style function definitions</title>
<updated>2017-08-23T11:55:35+00:00</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2017-06-27T22:17:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=8566334a211ca32bc441c99b23eb96182216067b'/>
<id>urn:sha1:8566334a211ca32bc441c99b23eb96182216067b</id>
<content type='text'>
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Ron Yorston &lt;rmy@pobox.com&gt;
</content>
</entry>
<entry>
<title>win32: Import fnmatch source</title>
<updated>2010-09-10T08:39:17+00:00</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2010-04-14T00:01:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=3a9514cceca86f1c33c82fb879396789defb8f51'/>
<id>urn:sha1:3a9514cceca86f1c33c82fb879396789defb8f51</id>
<content type='text'>
This was extracted from commit e56b799d6ad8afba4168fffa7218d44c041a72d2
in Git repository.
</content>
</entry>
</feed>
