From: Rémi Bernon <rbernon@codeweavers.com> Doing it after --pos causes an off by one error and strips one character at the end of the name. It also doesn't need to be conditional if we initialize it before the loop. --- dlls/ntdll/unix/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index b1233afc07c..9d70aa421f0 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1329,6 +1329,7 @@ NTSTATUS load_unixlib_by_name( const UNICODE_STRING *nt_name, void **handle_ret if (!(file = malloc( maxlen ))) return STATUS_NO_MEMORY; pos = maxlen - len - 4; + ext = file + pos + len; /* we don't want to depend on the current codepage here */ for (i = 0; i < len; i++) { @@ -1339,7 +1340,6 @@ NTSTATUS load_unixlib_by_name( const UNICODE_STRING *nt_name, void **handle_ret } file[pos + len] = 0; file[--pos] = '/'; - if (!ext) ext = file + pos + len; if (build_dir) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10597