libwine: Try to load all modules in the programs directory, not just those with .exe extension.

This commit is contained in:
Alexandre Julliard 2009-02-24 18:11:53 +01:00
parent 6c8e3a8539
commit cee15b2449
1 changed files with 10 additions and 9 deletions

View File

@ -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)