[ forwarded to wine-devel, potential for controversy ]
Patch: open-builtin-exe
Modified files: scheduler: process.c
Log Message: Martin Wilck Martin.Wilck@fujitsu-siemens.com
Winelib apps often (almost always) have mixed upper/lower case names and are therefore never found by open_builtin_exe(). Fix that, without breaking the default (all-lowercase name) for builtin apps.
Index: scheduler/process.c =================================================================== RCS file: /home/wine/wine/scheduler/process.c,v retrieving revision 1.198 diff -u -r1.198 process.c --- scheduler/process.c 27 Aug 2002 01:13:59 -0000 1.198 +++ scheduler/process.c 17 Sep 2002 16:55:18 -0000 @@ -265,11 +265,15 @@ { char exename[MAX_PATH], *p; const char *basename = get_basename(name); + void *exeptr;
if (strlen(basename) >= sizeof(exename)) return NULL; strcpy( exename, basename ); for (p = exename; *p; p++) *p = FILE_tolower(*p); - return wine_dll_load_main_exe( exename, error, error_size, test_only ); + exeptr = wine_dll_load_main_exe( exename, error, error_size, test_only ); + if ( exeptr ) return exeptr; + /* If lower-case name fails, try potential mixed-case name (for Winelib) */ + return wine_dll_load_main_exe( basename, error, error_size, test_only ); }
Martin Wilck Martin.Wilck@Fujitsu-Siemens.com writes:
Winelib apps often (almost always) have mixed upper/lower case names and are therefore never found by open_builtin_exe(). Fix that, without breaking the default (all-lowercase name) for builtin apps.
Mixed case is going to cause trouble in many situations, I don't think we will be able to make it work right. IMO we should simply have .exe.so files always be lower case.
Am Die, 2002-09-17 um 19.39 schrieb Alexandre Julliard:
Mixed case is going to cause trouble in many situations, I don't think we will be able to make it work right. IMO we should simply have .exe.so files always be lower case.
But what harm can it do here? Lower-case is tried first. With the patch, open_builtin_exe() just succeeds in a few more cases where otherwise wine would simply bail out and say it can't find the application.
If this is really so dangerous that it can't be applied, winemaker must be changed to make the .exe.so's automatically lower case.
Definitely, if you import a VC++ project, almost all components will be mixed case, and so will the targets that winemaker currently generates.
That is, such applications currently can't be run (in the expected way) after a "make install".
Martin
Martin Wilck Martin.Wilck@Fujitsu-Siemens.com writes:
But what harm can it do here? Lower-case is tried first. With the patch, open_builtin_exe() just succeeds in a few more cases where otherwise wine would simply bail out and say it can't find the application.
If this is really so dangerous that it can't be applied, winemaker must be changed to make the .exe.so's automatically lower case.
It's not that it's really dangerous, it simply doesn't solve the issue except in that very specific case. There are many other places, notably the loadorder support, where we cannot do case-sensitive lookups. And yes, I think winemaker should make the .exe.so's lower case (and the dlls too BTW, they will have the same problem).
Am Die, 2002-09-17 um 20.26 schrieb Alexandre Julliard:
And yes, I think winemaker should make the .exe.so's lower case (and the dlls too BTW, they will have the same problem).
Well - I thought that'd be horribly complex. It seems that it isn't, see patch below.
Patch: winemaker-case.diff
Modified files: tools: winemaker
Log Message: Martin Wilck Martin.Wilck@fujitsu-siemens.com: Make all target names lower case.
Index: tools/winemaker =================================================================== RCS file: /home/wine/wine/tools/winemaker,v retrieving revision 1.51 diff -u -r1.51 winemaker --- tools/winemaker 13 Sep 2002 17:55:54 -0000 1.51 +++ tools/winemaker 17 Sep 2002 18:41:58 -0000 @@ -784,7 +784,7 @@ my @local_dlls=(); my @local_depends=(); my @exe_list=(); - foreach my $target_name (sort { $b cmp $a } keys %targets) { + foreach my $target_name (map (lc, (sort { $b cmp $a } keys %targets))) { # Create the target... my $basename; my $target=[];