winefile: Fix collapsing when there's no parent directory

André Hentschel nerv at dawncrow.de
Mon Jan 16 15:55:38 CST 2012


Fixes a crash when you are at / (unix fs) and double click ..
---
 programs/winefile/winefile.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c
index 63ce463..afb73fe 100644
--- a/programs/winefile/winefile.c
+++ b/programs/winefile/winefile.c
@@ -3563,9 +3563,13 @@ static BOOL expand_entry(ChildWnd* child, Entry* dir)
 
 static void collapse_entry(Pane* pane, Entry* dir)
 {
-	int idx = SendMessageW(pane->hwnd, LB_FINDSTRING, 0, (LPARAM)dir);
+    int idx;
 
-	ShowWindow(pane->hwnd, SW_HIDE);
+    if (!dir)
+        return;
+
+    idx = SendMessageW(pane->hwnd, LB_FINDSTRING, 0, (LPARAM)dir);
+    ShowWindow(pane->hwnd, SW_HIDE);
 
 	/* hide sub entries */
 	for(;;) {
-- 

Best Regards, André Hentschel
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Nachrichtenteil als Anhang
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20120116/47333e22/attachment.ksh>


More information about the wine-patches mailing list