winefile: check for a valid supplied path

Jeff Zaroyko jeffzaroyko at gmail.com
Thu Jan 22 08:50:09 CST 2009


Fixes a crash (bug 13631) when pressing F5 to refresh after an invalid
path has been supplied to winefile, instead just act as if no argument
had been supplied.
-------------- next part --------------
From 0a5d5be9de48e596a653638383915bf7933d5823 Mon Sep 17 00:00:00 2001
From: Jeff Zaroyko <jeffz at jeffz.name>
Date: Fri, 23 Jan 2009 01:14:28 +1100
Subject: winefile: check for a valid supplied path

---
 programs/winefile/winefile.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c
index 2caff8e..170292a 100644
--- a/programs/winefile/winefile.c
+++ b/programs/winefile/winefile.c
@@ -4888,6 +4888,8 @@ static int winefile_main(HINSTANCE hinstance, int cmdshow, LPCTSTR path)
   
 	InitInstance(hinstance);
 
+        if(lstrlen(path) && !SetCurrentDirectory(path))
+           path = sEmpty;
 	show_frame(0, cmdshow, path);
 
 	while(GetMessage(&msg, 0, 0, 0)) {
-- 
1.5.4.3


More information about the wine-patches mailing list