Module: wine Branch: refs/heads/master Commit: d6cb3e8b98969a90954623ce9f984048e96b9792 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=d6cb3e8b98969a90954623ce...
Author: Mikołaj Zalewski mikolaj@zalewski.pl Date: Mon Apr 17 17:01:11 2006 +0200
progman: Fix two simple bugs.
Use correctly the GetOpenFileName function. Use _lcreat instead of _lopen to create a new file.
---
programs/progman/dialog.c | 12 ++++++------ programs/progman/grpfile.c | 10 +--------- 2 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/programs/progman/dialog.c b/programs/progman/dialog.c index fbfdc23..50713a0 100644 --- a/programs/progman/dialog.c +++ b/programs/progman/dialog.c @@ -328,6 +328,7 @@ static BOOL CALLBACK DIALOG_PROGRAM_DlgP case PM_BROWSE: { CHAR filename[MAX_PATHNAME_LEN]; + filename[0] = 0; if (DIALOG_BrowsePrograms(hDlg, filename, sizeof(filename))) SetDlgItemText(hDlg, PM_COMMAND_LINE, filename); return TRUE; @@ -450,6 +451,7 @@ static BOOL CALLBACK DIALOG_SYMBOL_DlgPr case PM_BROWSE: { CHAR filename[MAX_PATHNAME_LEN]; + filename[0] = 0; if (DIALOG_BrowseSymbols(hDlg, filename, sizeof(filename))) SetDlgItemText(hDlg, PM_ICON_FILE, filename); return TRUE; @@ -518,6 +520,7 @@ static BOOL CALLBACK DIALOG_EXECUTE_DlgP case PM_BROWSE: { CHAR filename[MAX_PATHNAME_LEN]; + filename[0] = 0; if (DIALOG_BrowsePrograms(hDlg, filename, sizeof(filename))) SetDlgItemText(hDlg, PM_COMMAND, filename); return TRUE; @@ -559,21 +562,19 @@ static BOOL DIALOG_Browse(HWND hDlg, LPC { OPENFILENAME openfilename;
- CHAR szPath[MAX_PATH]; CHAR szDir[MAX_PATH]; CHAR szDefaultExt[] = "exe";
ZeroMemory(&openfilename, sizeof(openfilename));
GetCurrentDirectory(sizeof(szDir), szDir); - lstrcpy(szPath,"*.exe");
- /* FIXME is this correct ? */ openfilename.lStructSize = sizeof(openfilename); openfilename.hwndOwner = Globals.hMainWnd; openfilename.hInstance = Globals.hInstance; - openfilename.lpstrFile = szPath; - openfilename.nMaxFile = sizeof(szPath); + openfilename.lpstrFilter = lpszzFilter; + openfilename.lpstrFile = lpstrFile; + openfilename.nMaxFile = nMaxFile; openfilename.lpstrInitialDir = szDir; openfilename.Flags = 0; openfilename.lpstrDefExt = szDefaultExt; @@ -591,7 +592,6 @@ static BOOL DIALOG_Browse(HWND hDlg, LPC openfilename.lpTemplateName = 0;
return GetOpenFileName(&openfilename); - /* FIXME */ }
/*********************************************************************** diff --git a/programs/progman/grpfile.c b/programs/progman/grpfile.c index 8174308..5b9d11f 100644 --- a/programs/progman/grpfile.c +++ b/programs/progman/grpfile.c @@ -399,16 +399,8 @@ BOOL GRPFILE_WriteGroupFile(HLOCAL hGrou MB_OKCANCEL | MB_DEFBUTTON2)) return FALSE; }
- /* FIXME */ - if (OpenFile(szPath, &dummy, OF_EXIST) == HFILE_ERROR) - { - CHAR msg[MAX_PATHNAME_LEN + 200]; - wsprintf(msg, "Cause of a bug you must now touch the file %s\n", szPath); - MessageBox(Globals.hMainWnd, msg, "", MB_OK); - } - /* Open file */ - file = _lopen(szPath, OF_WRITE); + file = _lcreat(szPath, 0); if (file != HFILE_ERROR) { ret = GRPFILE_DoWriteGroupFile(file, group);