<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/scripts, branch master</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=master</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2026-04-18T09:27:47+00:00</updated>
<entry>
<title>Win32: trivial refinements (#577)</title>
<updated>2026-04-18T09:27:47+00:00</updated>
<author>
<name>avih</name>
<email>2164962+avih@users.noreply.github.com</email>
</author>
<published>2026-04-18T09:27:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=0495eb5c75d62fc574a8c5477f9196f0917f723d'/>
<id>urn:sha1:0495eb5c75d62fc574a8c5477f9196f0917f723d</id>
<content type='text'>
* win32: fnmatch2 minor refinements (no-op)

With beacket, add '\' to the switch/case, and at fnmatch, pre-calc
the two most used flags (CASEFOLD and PATHNAME) once on init.

Negligible perf impact, and happens to save few bytes in x64.

* win32: actype: trivial refinments (no-op)

NULL was used in actype.h but requires stddef.h - which we don't
include, so use (int*)0 which also expresses it more clearly.

Remove "#include &lt;string.h&gt;" at actype.c, which we don't need anymore.

* scripts/patbench.sh: make executable (chmod +x)</content>
</entry>
<entry>
<title>scripts/patbench.sh: add patterns, verify results</title>
<updated>2026-04-16T09:42:13+00:00</updated>
<author>
<name>Avi Halachmi (:avih)</name>
<email>avihpit@yahoo.com</email>
</author>
<published>2026-04-15T15:51:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=797628de79fe79e95da3e783b10a642c6e03c234'/>
<id>urn:sha1:797628de79fe79e95da3e783b10a642c6e03c234</id>
<content type='text'>
Few minor improvements:
- Add few valid but edge-case patterns (start with ']' etc).
- Add the expected result for default lines, and report ok/err.
- Disable measurements with -mn (to be measured externally).

Also, the default lines were modified slightly so that the new
edge cases results are largely distinct, so it can be used as
correctness test with -d (and exit code is 1 on errors).

BENCHMARK RESULTS

Below are results of running this script using busybox-w32 on win10,
and using busybox on Alpine linux 3.23.

Observations of busybox-w32 results, which uses old glibc fnmatch:

[10]    129 ms  OK      (M:12345)  '*[hello world, this is a test]*'
[42]  22491 ms  OK      (M:12-45)  '*[0-9A-Za-z]*[0-9A-Za-z]*[0-9A-Za-z]'

The current busybox-w32 implementation is exponential, and while
tests of simple patterns complete in 100-200ms, patterns with 3 '*'
can take 30s or more to complete, way longer with 4 '*', etc.

[12]    192 ms  E:1-3-- (M:-----)  '*[*'
[13]    201 ms  E:1---- (M:-----)  '*[]*'
[14]    203 ms  E:--3-- (M:-----)  '*[!]*'

A bracket which doesn't start a bracket expression is regular char,
and all these are missing the closing bracket (by POSIX rules), and
should be matched literally, but the current fnmatch fails with that.

[35]   1305 ms  OK      (M:12-45)  '*[0-9A-Za-z]*[0-9A-Za-z]'
[36]   1928 ms  OK      (M:12-45)  '*[[:alnum:]]*[[:alnum:]]'

[38]   1446 ms  OK      (M:12-45)  '*[a-bc-de-z]*[a-bc-de-z]'
[39]   3192 ms  OK      (M:12-45)  '*[[:lower:]]*[[:lower:]]'

[40]   1586 ms  OK      (M:---4-)  '*[0-9A-Fa-ef]*[0-9A-Fa-ef]'
[41]   4601 ms  OK      (M:---4-)  '*[[:xdigit:]]*[[:xdigit:]]'

charclass [:alnum:] is x1.4 slower than an equivalent non-class range,
but [:lower:] is already x2 slower than the equivalent, and [:xdigit:]
is x3 slower than the equivalent. This is because the name is searched
in a list which starts with "alnum" and ends in "xdigit", and the
search duration (and the following switch in the same order) clearly
affects how quickly a pattern can be tested.

There are other issues in busybox-w32 fnmatch, like incorrect
case-insensitivity and more, but which don't manifest in case...esac.

Benchmark results with busybox-w32 on Windows 10 (compiled with gcc):

[ 1]    107 ms  OK      (M:-----)  ''
[ 2]    108 ms  OK      (M:12345)  '*'
[ 3]    104 ms  OK      (M:-----)  '@'
[ 4]    112 ms  OK      (M:1----)  'Lorem*'
[ 5]    120 ms  OK      (M:-2---)  '*quis'
[ 6]    127 ms  OK      (M:--3--)  '*nisi*'
[ 7]    244 ms  OK      (M:--3--)  '*[fobar]xyz*'
[ 8]    544 ms  OK      (M:--3--)  '*[foobarfoobarfoobarfoobar]xyz*'
[ 9]    588 ms  OK      (M:-2---)  '*[!foobarfoobarfoobarfoobar]xyz*'
[10]    129 ms  OK      (M:12345)  '*[hello world, this is a test]*'
[11]    136 ms  OK      (M:12345)  '*[!hello world, this is a test]*'
[12]    192 ms  E:1-3-- (M:-----)  '*[*'
[13]    201 ms  E:1---- (M:-----)  '*[]*'
[14]    203 ms  E:--3-- (M:-----)  '*[!]*'
[15]    182 ms  OK      (M:-23-5)  '*[!]].*'
[16]    454 ms  OK      (M:1----)  '*[![:print:]]*'
[17]    124 ms  OK      (M:-23--)  '*z*'
[18]    123 ms  OK      (M:---4-)  '*-*'
[19]    160 ms  OK      (M:---4-)  '*[-]*'
[20]    175 ms  OK      (M:-234-)  '*[-z]*'
[21]    177 ms  OK      (M:-234-)  '*[z-]*'
[22]    197 ms  OK      (M:-234-)  '*[-z-]*'
[23]    126 ms  OK      (M:1-3--)  '*]*'
[24]    168 ms  OK      (M:1-3--)  '*[]]*'
[25]    173 ms  OK      (M:1-34-)  '*[]-]*'
[26]    168 ms  OK      (M:123--)  '*[]-_]*'
[27]    170 ms  OK      (M:1234-)  '*[]-_-]*'
[28]    365 ms  OK      (M:12-45)  '*[0-9A-Za-z][0-9A-Za-z]'
[29]    513 ms  OK      (M:12-45)  '*[[:alnum:]][[:alnum:]]'
[30]    263 ms  OK      (M:12-45)  '*[a-z][a-z]'
[31]    376 ms  OK      (M:12-45)  '*[a-bc-de-z][a-bc-de-z]'
[32]    815 ms  OK      (M:12-45)  '*[[:lower:]][[:lower:]]'
[33]    311 ms  OK      (M:-----)  '*[0-9A-Fa-ef][0-9A-Fa-ef]'
[34]    756 ms  OK      (M:-----)  '*[[:xdigit:]][[:xdigit:]]'
[35]   1305 ms  OK      (M:12-45)  '*[0-9A-Za-z]*[0-9A-Za-z]'
[36]   1928 ms  OK      (M:12-45)  '*[[:alnum:]]*[[:alnum:]]'
[37]    919 ms  OK      (M:12-45)  '*[a-z]*[a-z]'
[38]   1446 ms  OK      (M:12-45)  '*[a-bc-de-z]*[a-bc-de-z]'
[39]   3192 ms  OK      (M:12-45)  '*[[:lower:]]*[[:lower:]]'
[40]   1586 ms  OK      (M:---4-)  '*[0-9A-Fa-ef]*[0-9A-Fa-ef]'
[41]   4601 ms  OK      (M:---4-)  '*[[:xdigit:]]*[[:xdigit:]]'
[42]  22491 ms  OK      (M:12-45)  '*[0-9A-Za-z]*[0-9A-Za-z]*[0-9A-Za-z]'
(aborted manually - exponential implementation becomes very slow)

results with busybox on Alpine linux 3.23 (musl-libc has linear-time
fnmatch, using wide-char wctype/iswctype - slightly slower than char):

[ 1]    135 ms  OK      (M:-----)  ''
[ 2]    141 ms  OK      (M:12345)  '*'
[ 3]    139 ms  OK      (M:-----)  '@'
[ 4]    141 ms  OK      (M:1----)  'Lorem*'
[ 5]    148 ms  OK      (M:-2---)  '*quis'
[ 6]    216 ms  OK      (M:--3--)  '*nisi*'
[ 7]    410 ms  OK      (M:--3--)  '*[fobar]xyz*'
[ 8]    787 ms  OK      (M:--3--)  '*[foobarfoobarfoobarfoobar]xyz*'
[ 9]    844 ms  OK      (M:-2---)  '*[!foobarfoobarfoobarfoobar]xyz*'
[10]    215 ms  OK      (M:12345)  '*[hello world, this is a test]*'
[11]    237 ms  OK      (M:12345)  '*[!hello world, this is a test]*'
[12]    206 ms  OK      (M:1-3--)  '*[*'
[13]    242 ms  OK      (M:1----)  '*[]*'
[14]    220 ms  OK      (M:--3--)  '*[!]*'
[15]    306 ms  OK      (M:-23-5)  '*[!]].*'
[16]    591 ms  OK      (M:1----)  '*[![:print:]]*'
[17]    216 ms  OK      (M:-23--)  '*z*'
[18]    198 ms  OK      (M:---4-)  '*-*'
[19]    286 ms  OK      (M:---4-)  '*[-]*'
[20]    285 ms  OK      (M:-234-)  '*[-z]*'
[21]    291 ms  OK      (M:-234-)  '*[z-]*'
[22]    299 ms  OK      (M:-234-)  '*[-z-]*'
[23]    228 ms  OK      (M:1-3--)  '*]*'
[24]    286 ms  OK      (M:1-3--)  '*[]]*'
[25]    267 ms  OK      (M:1-34-)  '*[]-]*'
[26]    349 ms  OK      (M:123--)  '*[]-_]*'
[27]    292 ms  OK      (M:1234-)  '*[]-_-]*'
[28]    198 ms  OK      (M:12-45)  '*[0-9A-Za-z][0-9A-Za-z]'
[29]    201 ms  OK      (M:12-45)  '*[[:alnum:]][[:alnum:]]'
[30]    179 ms  OK      (M:12-45)  '*[a-z][a-z]'
[31]    217 ms  OK      (M:12-45)  '*[a-bc-de-z][a-bc-de-z]'
[32]    205 ms  OK      (M:12-45)  '*[[:lower:]][[:lower:]]'
[33]    202 ms  OK      (M:-----)  '*[0-9A-Fa-ef][0-9A-Fa-ef]'
[34]    203 ms  OK      (M:-----)  '*[[:xdigit:]][[:xdigit:]]'
[35]    215 ms  OK      (M:12-45)  '*[0-9A-Za-z]*[0-9A-Za-z]'
[36]    213 ms  OK      (M:12-45)  '*[[:alnum:]]*[[:alnum:]]'
[37]    191 ms  OK      (M:12-45)  '*[a-z]*[a-z]'
[38]    219 ms  OK      (M:12-45)  '*[a-bc-de-z]*[a-bc-de-z]'
[39]    224 ms  OK      (M:12-45)  '*[[:lower:]]*[[:lower:]]'
[40]    217 ms  OK      (M:---4-)  '*[0-9A-Fa-ef]*[0-9A-Fa-ef]'
[41]    199 ms  OK      (M:---4-)  '*[[:xdigit:]]*[[:xdigit:]]'
[42]    227 ms  OK      (M:12-45)  '*[0-9A-Za-z]*[0-9A-Za-z]*[0-9A-Za-z]'
[43]    239 ms  OK      (M:12-45)  '*[[:alnum:]]*[[:alnum:]]*[[:alnum:]]'
[44]    204 ms  OK      (M:12-45)  '*[a-z]*[a-z]*[a-z]'
[45]    258 ms  OK      (M:12-45)  '*[a-bc-de-z]*[a-bc-de-z]*[a-bc-de-z]'
[46]    235 ms  OK      (M:12-45)  '*[[:lower:]]*[[:lower:]]*[[:lower:]]'
[47]    247 ms  OK      (M:---4-)  '*[0-9A-Fa-ef]*[0-9A-Fa-ef]*[0-9A-Fa-ef]'
[48]    247 ms  OK      (M:---4-)  '*[[:xdigit:]]*[[:xdigit:]]*[[:xdigit:]]'
[49]    286 ms  OK      (M:12-45)  '*[0-9A-Za-z]*[0-9A-Za-z]*[0-9A-Za-z]*[0-9A-Za-z]'
[50]    262 ms  OK      (M:12-45)  '*[[:alnum:]]*[[:alnum:]]*[[:alnum:]]*[[:alnum:]]'
[51]    219 ms  OK      (M:12-45)  '*[a-z]*[a-z]*[a-z]*[a-z]'
[52]    273 ms  OK      (M:12-45)  '*[a-bc-de-z]*[a-bc-de-z]*[a-bc-de-z]*[a-bc-de-z]'
[53]    274 ms  OK      (M:12-45)  '*[[:lower:]]*[[:lower:]]*[[:lower:]]*[[:lower:]]'
[54]    281 ms  OK      (M:---4-)  '*[0-9A-Fa-ef]*[0-9A-Fa-ef]*[0-9A-Fa-ef]*[0-9A-Fa-ef]'
[55]    296 ms  OK      (M:---4-)  '*[[:xdigit:]]*[[:xdigit:]]*[[:xdigit:]]*[[:xdigit:]]'
</content>
</entry>
<entry>
<title>scripts/patbench.sh: new shell patterns benchmark</title>
<updated>2026-04-16T09:42:13+00:00</updated>
<author>
<name>Avi Halachmi (:avih)</name>
<email>avihpit@yahoo.com</email>
</author>
<published>2026-04-12T04:45:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=0954c248c879e3859c5e9da573979be643d9f2ab'/>
<id>urn:sha1:0954c248c879e3859c5e9da573979be643d9f2ab</id>
<content type='text'>
This script measures the performance of shell pattern matching,
with increasing pattern complexity (more '*' at the pattern).
</content>
</entry>
<entry>
<title>Merge branch 'busybox' into merge</title>
<updated>2026-03-11T10:14:49+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2026-03-11T10:14:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=ede205bd07573813337b5706acb0cae3b127a36f'/>
<id>urn:sha1:ede205bd07573813337b5706acb0cae3b127a36f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>*: placate warnings where strchr/strstr returns constant pointer</title>
<updated>2026-02-15T14:15:30+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2026-02-15T13:41:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=b668e52c906b664b353d5a99cfa3ff36f73b341d'/>
<id>urn:sha1:b668e52c906b664b353d5a99cfa3ff36f73b341d</id>
<content type='text'>
Newer glibc is now smarter and can propagate const-ness from those!

function                                             old     new   delta
readtoken1                                          3111    3108      -3

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>win32: wcwidth_alt.c: new generator script, re-generate code</title>
<updated>2025-12-29T13:57:05+00:00</updated>
<author>
<name>Avi Halachmi (:avih)</name>
<email>avihpit@yahoo.com</email>
</author>
<published>2025-12-25T22:02:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=6f847c296bf94401c0c147bf3c5aa1e8531b9dbf'/>
<id>urn:sha1:6f847c296bf94401c0c147bf3c5aa1e8531b9dbf</id>
<content type='text'>
Previously, scripts/mkwcwidth generated a wcwidth implementation based
on input from the python wcwidth: https://github.com/jquast/wcwidth .

However, that project is not updated frequently, and the less
dependencies - the better.

This new script instead prints an implementation based directly on the
original Unicode files - which it can also download.

It generates the same code as before (same data structures, etc).

It was then used to re-generate libbb/wcwidth_alt.c, as follows:

  ./scripts/mkwcwidth DL=15.1.0 FAST_FUNC &gt; libbb/wcwidth_alt.c

This is the same Unicode version as the previous file, just to make
the codepoint differences visible easily.

These differences are very small, and the script itself explains where
and why it differs from https://github.com/jquast/wcwidth .

Next commits will update the tables to the latest unicode version.
</content>
</entry>
<entry>
<title>Use Windows library for cryptographic checksums</title>
<updated>2025-06-09T12:23:49+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2025-06-09T12:23:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=596c443112d09506c3bf13ac98046a84b912e56c'/>
<id>urn:sha1:596c443112d09506c3bf13ac98046a84b912e56c</id>
<content type='text'>
Add a new feature to libbb, FEATURE_USE_CNG_API, which enables the
use of the Cryptography API: Next Generation library to calculate
checksums.  It is disabled by default except in the mingw64u default
config, as the API requires Windows 10+ to function.  Usage of this
API provides a size benefit and delegates hardware optimizations to
the operating system cryptography library.

Based on GitHub PR #498 by rfl890.

Saves 4064 bytes in the mingw64u case.
</content>
</entry>
<entry>
<title>Merge branch 'busybox' into merge</title>
<updated>2025-05-19T07:34:32+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2025-05-19T07:34:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=64bf69893bd99c305d13a956389f216e7d15c682'/>
<id>urn:sha1:64bf69893bd99c305d13a956389f216e7d15c682</id>
<content type='text'>
</content>
</entry>
<entry>
<title>archival: disallow path traversals (CVE-2023-39810)</title>
<updated>2025-04-16T01:03:17+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2024-10-02T08:12:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=9a8796436b9b0641e13480811902ea2ac57881d3'/>
<id>urn:sha1:9a8796436b9b0641e13480811902ea2ac57881d3</id>
<content type='text'>
Create new configure option for archival/libarchive based extractions to
disallow path traversals.
As this is a paranoid option and might introduce backward
incompatibility, default it to no.

Fixes: CVE-2023-39810

Based on the patch by Peter Kaestle &lt;peter.kaestle@nokia.com&gt;

function                                             old     new   delta
data_extract_all                                     921     945     +24
strip_unsafe_prefix                                  101     102      +1
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 25/0)               Total: 25 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>Update PDCurses</title>
<updated>2025-04-10T18:41:43+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2025-04-10T18:41:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=486c1fcc341472fd8d64b820c3a7934cf3f42132'/>
<id>urn:sha1:486c1fcc341472fd8d64b820c3a7934cf3f42132</id>
<content type='text'>
</content>
</entry>
</feed>
