On 2025-01-12 Bruno Haible wrote:
> As I understand it, the patch modifies the conversion
>   wchar_t[] (UTF-16)  -->  char[]
> used for file names, and it does so only for opendir+readdir.

The way I see it, the patch adds error detection to the conversion.
Names that pass the check are returned just like they were before.

If a file name contains the infinity symbol, let's say "∞.txt",
best-fit mapping to Windows-1252 makes current readdir() return "8.txt".
Passing "8.txt" to open() won't open "∞.txt". If the active code page is
Windows-1252, one cannot use Gnulib's open module to access "∞.txt".

The patch makes readdir() detect that lossless conversion isn't
possible and inform the application with EOVERFLOW instead of returning
a made-up name that might even be dangerous. I don't see how this could
affect open(), chdir(), etc. negatively.

If you suspect that I'm missing something, please try to explain again.
Thanks!

-- 
Lasse Collin

Reply via email to