Files
scriptc/tests
Malte UblandClaude Opus 5.5 4d939e55c7 Sort directory entry names by their raw bytes before decoding them
libuv's uv_fs_scandir sorts the raw directory-entry bytes with strcmp and
decodes the names only after sorting. Sorting the decoded text instead
reorders names that are not valid UTF-8: the malformed bytes 0x80 and 0xfe
decode to U+FFFD, which sorts after "é", and distinct names that decode to
the same text fall into an arbitrary order. readdir and readdirSync listed
those names in an order Node never produces.

scr_fs_scandir now collects the raw names, sorts them with strcmp, and then
decodes each one into the ScrScandir.

The malformed UTF-8 harness test also prints the unsorted readdir order and
carries names whose byte order and decoded order differ.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 06:45:11 -07:00
..
…