[PATCH 1/2] kernel32/path: Allow renaming a file/directory to a different capitalization of itself

Zebediah Figura z.figura12 at gmail.com
Mon Mar 11 17:44:25 CDT 2019


On 3/11/19 8:50 AM, Gabriel Ivăncescu wrote:
> Renaming a file or directory from e.g. foobar to FooBar (or any other
> caps-only change) should work and capitalize it, like on Windows, instead
> of being a no-op.
> 
> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46203
> Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
> ---
> 
> Currently Wine simply finds the existing foobar and thus "changes" it from
> foobar to foobar, which is a no-op and wrong. This is especially annoying
> with file managers when trying to rename files to different capitalization...
> 
> The __wine_wcstoumbs is taken from the similar __wine_init_codepages layout
> used in locale.c. I've had to do it this way and export it because accessing
> the ntdll_wcstoumbs internal function is required here to build the filename
> in its original capitalization, untouched.
> 
> I am aware that the extern function declaration may not be acceptable, but
> I made it similar to __wine_init_codepages. I'd appreciate some feedback
> on how to do this better.
> 

Can't you just use WideCharToMultiByte() with CP_UNIXCP? Unless I'm 
misreading that does the same thing.



More information about the wine-devel mailing list