[PATCH] [bug 3243] Save dialog works if fred\ entered as filename

Jason Edmeades jason.edmeades at googlemail.com
Sat Jul 28 14:34:49 CDT 2007


On windows, (eg. notepad), if you save as, then type garbage\ as the filename
(and a directory with than name doesnt exist!) then it will complain. Wine
returns this as the text - Note this only affects when OFN_PATHMUSTEXIST
is set. Tested with notepad (and comdlgtst)
---
 dlls/comdlg32/filedlg.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c
index e8e82f2..ca058f2 100644
--- a/dlls/comdlg32/filedlg.c
+++ b/dlls/comdlg32/filedlg.c
@@ -1958,7 +1958,8 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
       }
       else if (!(fodInfos->ofnInfos->Flags & OFN_NOVALIDATE))
       {
-	if(*lpszTemp)	/* points to trailing null for last path element */
+	if(*lpszTemp ||	/* points to trailing null for last path element */
+           (lpwstrTemp[strlenW(lpwstrTemp)-1] == '\\')) /* or if last element ends in '\' */
         {
 	  if(fodInfos->ofnInfos->Flags & OFN_PATHMUSTEXIST)
 	  {
-- 
1.5.0




More information about the wine-patches mailing list