ports/emulators/wine-proton/files/patch-dlls_ntdll_unix_loader.c
Alex S 519b9d1c5d emulators/wine-proton: update to 9.0-1
PR:		278940
Approved by:	maintainer/submitter
2024-05-14 22:00:47 -04:00

24 lines
814 B
C

--- dlls/ntdll/unix/loader.c.orig 2024-04-05 17:03:05 UTC
+++ dlls/ntdll/unix/loader.c
@@ -480,6 +480,21 @@ char *get_alternate_wineloader( WORD machine )
if (machine == current_machine) return NULL;
+ char* wineserver_path = getenv("WINESERVER");
+ if (wineserver_path != NULL && wineserver_path[0] == '/') {
+ char* s = remove_tail(wineserver_path, "server");
+ if (s != NULL) {
+ if (machine == IMAGE_FILE_MACHINE_AMD64) {
+ ret = malloc(strlen(s) + 3);
+ strcpy(ret, s);
+ strcat(ret, "64");
+ } else {
+ ret = s;
+ }
+ return ret;
+ }
+ }
+
if (machine == IMAGE_FILE_MACHINE_AMD64) /* try the 64-bit loader */
{
size_t len = strlen(wineloader);