From cee15b24496e9c15bf7c7f2d3cf1b781212ce435 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 24 Feb 2009 18:11:53 +0100 Subject: [PATCH] libwine: Try to load all modules in the programs directory, not just those with .exe extension. --- libs/wine/loader.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/libs/wine/loader.c b/libs/wine/loader.c index dde5a70d04e..b7dd8b39b23 100644 --- a/libs/wine/loader.c +++ b/libs/wine/loader.c @@ -169,22 +169,23 @@ static char *next_dll_path( struct dll_path_context *context ) switch(index) { - case 0: /* try programs dir for .exe files */ - if (!context->win16 && namelen > 4 && !memcmp( context->name + namelen - 4, ".exe", 4 )) + case 0: /* try dlls dir with subdir prefix */ + if (namelen > 4 && !memcmp( context->name + namelen - 4, ".dll", 4 )) namelen -= 4; + if (!context->win16) path = prepend( path, context->name, namelen ); + path = prepend( path, "/dlls", sizeof("/dlls") - 1 ); + path = prepend( path, build_dir, strlen(build_dir) ); + return path; + case 1: /* try programs dir with subdir prefix */ + if (!context->win16) { - path = prepend( path, context->name, namelen - 4 ); + if (namelen > 4 && !memcmp( context->name + namelen - 4, ".exe", 4 )) namelen -= 4; + path = prepend( path, context->name, namelen ); path = prepend( path, "/programs", sizeof("/programs") - 1 ); path = prepend( path, build_dir, strlen(build_dir) ); return path; } context->index++; /* fall through */ - case 1: /* try dlls dir with subdir prefix */ - if (namelen > 4 && !memcmp( context->name + namelen - 4, ".dll", 4 )) namelen -= 4; - if (!context->win16) path = prepend( path, context->name, namelen ); - path = prepend( path, "/dlls", sizeof("/dlls") - 1 ); - path = prepend( path, build_dir, strlen(build_dir) ); - return path; default: index -= 2; if (index < nb_dll_paths) -- 2.11.4.GIT