Dan Kegel wrote:
Tony Lambregts wrote:
What about reversing the order: first try the DOS path, if that fails, try the Unix one...
It is not possible to easily reverse the order in wine searches DOSFS_GetPathDrive. If it sees a "/" then it tries to use the path as a (absolute) unix one otherwise it just returns the current drive. Changing this behavior is not simple and however annoying the message is it is correct.
The message is correct, but Wine's behavior is not. I'm pretty sure you understand the issue, but for anyone still wondering: The problem is strictly theoretical at this point, but we should be aware of it in case somebody runs into it in the future. Here's the scenario:
- user installs MinGW or some other app that's been ported to Win32 but uses Unix-style path separators for win32 directories
- a path used by the program happens to exist both in the Windows filespace on drive C: (presumably this would be something installed by the app) and in the Unix filespace. For instance, the path /etc/blort/config might be a configuration file for a library used both on Linux and installed independently onto drive C: by the application.
- The app tries to open the file on drive C:, and gets the
file in Linux instead. Bang! The program crashes, or gives bad results.
Well... AFAICT this situation could only happen in a "Wine with windows" install. In a wine only installation this situation should not occure since wine will always choose the unix path. Perhaps it would be better to change the behavior so that Wine tries the path as a DOS path first but it isn't a quick and easy thing to do.
The reason I am interested in this is that there are a number of other bug/features in Wine's emulation of the DOS file system that I am looking at (1). Anyways at this point I am not as familiar/comforable with this section of the code to attempt to change it.
[snip]
Or something like that, yeah. We want to display a hint that there might be a misinterpretation of a DOS path as a Unix path.
so you really would want something more like this :
{ if ((drive = DRIVE_FindDriveRootW( name )) == -1) { - MESSAGE("Warning: %s not accessible from a configured DOS drive\n", debugstr_w(*name) ); + WARN("failed to find %s as an absolute unix path mapped to configured DOS drive \n", + debugstr_w(*name) ); + WARN("assuming it was a really a DOS name") /* Assume it really was a DOS name */ drive = DRIVE_GetCurrentDrive(); } + else + { + WARN("Using %s as a absolute unix path\n" debugstr_w(*name) ); + } } else drive = DRIVE_GetCurrentDrive();
Sort of dambed if we dambed if we don't. At least WARN's arn't automaticly spit out.