Remove .so extension from main module file name after loading it so

that GetModuleFileName returns the right thing.
This commit is contained in:
Alexandre Julliard 2002-07-31 17:53:42 +00:00
parent 69b2201883
commit 84dc1390ca
1 changed files with 5 additions and 1 deletions

View File

@ -621,7 +621,11 @@ void PROCESS_InitWine( int argc, char *argv[], LPSTR win16_exe_name, HANDLE *win
if (DOSFS_GetFullName( name, TRUE, &full_name )) name = full_name.long_name;
CloseHandle( main_exe_file );
main_exe_file = 0;
if (wine_dlopen( name, RTLD_NOW, error, sizeof(error) )) goto found;
if (wine_dlopen( name, RTLD_NOW, error, sizeof(error) ))
{
if ((p = strrchr( main_exe_name, '.' )) && !strcmp( p, ".so" )) *p = 0;
goto found;
}
MESSAGE( "%s: could not load '%s': %s\n", argv0, main_exe_name, error );
ExitProcess(1);
}