Alfred Agrell (@Alcaro) commented about dlls/kernelbase/loader.c:
+ if (j < 0) { + mui_name[k] = module_name[i]; + k++; + } + + /* When the position of the final backslash has been reached, add the locale name as */ + /* the folder/directory containing the "MUI" file and reset work index "j" to -1. */ + + if (i >= j && j > 0) { + for (l = 0; l < 5; l++) { + mui_name[k] = mui_locale[l]; + k++; + } + mui_name[k] = '/'; + k++; + j = -1; I think a second loop would be cleaner than messing with the j variable like that.
And I think a few wcscpy, wmemcpy and wcscat would be cleaner than those loops. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10365#note_134083