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

Gabriel Ivăncescu gabrielopcode at gmail.com
Tue Mar 12 05:50:05 CDT 2019


On 3/12/19 12:44 AM, Zebediah Figura wrote:
> 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.
> 
> 

Hi Zeb, thanks for that, I wasn't aware about it. If it does the same 
thing then that's great. Also, I guess I might have done some wrong 
rebasing on this patch due to the testbot failures, I'll see about it as 
well.



More information about the wine-devel mailing list