diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2025-02-27 13:51:39 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2025-02-27 13:51:39 +0100 |
commit | d4a5c2be8bc09823b9afd4c6eafd41981e5ed645 (patch) | |
tree | d5a436c27c29937ccc6247c8c4c4bbdf935333c8 /newlib/libc/stdlib/arc4random.c | |
parent | dc094c76657c2632196d3d67476a6c783ed0c285 (diff) | |
download | newlib-d4a5c2be8bc09823b9afd4c6eafd41981e5ed645.zip newlib-d4a5c2be8bc09823b9afd4c6eafd41981e5ed645.tar.gz newlib-d4a5c2be8bc09823b9afd4c6eafd41981e5ed645.tar.bz2 |
Cygwin: fhandler_netdrive: fix character conversion required for NFS shares
While filenames on NFS shares are converted internally to a widechar
representation of the input bytes treated as the default system ANSI
codepage (CP_ACP), this doesn't hold for share names. The names
returned by WNetEnumResourceW are just the original bytes dropped
verbatim into WCHAR.
The original conversion from 7db1c6fc4e2a ("Cygwin: //server: revert
to using WNet and support NFS shares") was erroneous in that it
treated the bytes as ISO-8859-1, not as CP_ACP codepoints.
Fix the conversion to convert from CP_ACP to widechar. Use a tmp_pathbuf
buffer for the new widechar string instead of malloc/free. Extend the
comment, better explaining the encoding difference between files and
shares.
Fixes: 7db1c6fc4e2a ("Cygwin: //server: revert to using WNet and support NFS shares")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'newlib/libc/stdlib/arc4random.c')
0 files changed, 0 insertions, 0 deletions