[Bug 21086] Bug in SearchPath when filename supplied but null
wine-bugs at winehq.org
wine-bugs at winehq.org
Sun Dec 20 15:15:28 CST 2009
http://bugs.winehq.org/show_bug.cgi?id=21086
--- Comment #6 from Jason Edmeades <us at edmeades.me.uk> 2009-12-20 15:15:28 ---
Yes, sorry... exactly...! On wine the SearchPath with no filename succeeds and
the app in question then tries to fopen the file, which fails as its trying to
open a directory!
Pasted here is a patch which solves the problem for my app and I think its the
simplest solution. (I would attach it as a patch but its cut and pasted from a
document I was maintaining for the app in question). Can you see if it makes
the test pass please (feel free to submit it, otherwise I'll try to send it in
when I get back to work and can get a proper patch file).
--- a/dlls/kernel32/path.c
+++ b/dlls/kernel32/path.c
@@ -753,6 +753,11 @@ DWORD WINAPI SearchPathW( LPCWSTR path, LPCWSTR name,
LPCWSTR ext, DWORD buflen,
DWORD ret = 0;
/* If the name contains an explicit path, ignore the path */
+ if (name && name[0] == 0x00) {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return 0;
+ }
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.
More information about the wine-bugs
mailing list