|
From: | Gisle Vanem |
Subject: | Re: [PATCH] canonicalize-lgpl: Canonicalize drive and dirsep too for MinGW. |
Date: | Sat, 11 Dec 2021 13:08:06 +0100 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
Jan Nieuwenhuizen wrote:
Do you see a cheap way to return the correct casing for the rest of the file name? That could be nice, maybe a change like that has a chance of being accepted.
The only safe way I've found is to call 'GetShortPathName()' and 'GetLongPathNameA()' to get the true correct casing: https://github.com/gvanem/EnvTool/blob/master/src/get_file_assoc.c#L165 Works fine if the file is not already on 8.3 SFN form. Or perhaps 'SHGetFileInfoA()' with the 'SHGFI_DISPLAYNAME' flag. See: https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shgetfileinfoa -- --gv
[Prev in Thread] | Current Thread | [Next in Thread] |