Alexander Scott-Johns : notepad: Fix trying to open non-existent files with the command line.
Alexandre Julliard
julliard at winehq.org
Thu Jul 2 08:25:09 CDT 2009
Module: wine
Branch: master
Commit: 42729bc1c1cc513a82cae4f793dccce52da71ddb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=42729bc1c1cc513a82cae4f793dccce52da71ddb
Author: Alexander Scott-Johns <alexander.scott.johns at googlemail.com>
Date: Tue Jun 30 21:25:02 2009 +0100
notepad: Fix trying to open non-existent files with the command line.
---
programs/notepad/dialog.c | 2 +-
programs/notepad/dialog.h | 1 +
programs/notepad/main.c | 3 ++-
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/programs/notepad/dialog.c b/programs/notepad/dialog.c
index d7354e7..026fe25 100644
--- a/programs/notepad/dialog.c
+++ b/programs/notepad/dialog.c
@@ -59,7 +59,7 @@ VOID ShowLastError(void)
* Untitled - Notepad if no file is open
* filename - Notepad if a file is given
*/
-static void UpdateWindowCaption(void)
+void UpdateWindowCaption(void)
{
WCHAR szCaption[MAX_STRING_LEN];
WCHAR szNotepad[MAX_STRING_LEN];
diff --git a/programs/notepad/dialog.h b/programs/notepad/dialog.h
index d927143..38c20e4 100644
--- a/programs/notepad/dialog.h
+++ b/programs/notepad/dialog.h
@@ -52,6 +52,7 @@ int DIALOG_StringMsgBox(HWND hParent, int formatId, LPCWSTR szString, DWORD dwFl
/* utility functions */
VOID ShowLastError(void);
+void UpdateWindowCaption(void);
BOOL FileExists(LPCWSTR szFilename);
BOOL DoCloseFile(void);
void DoOpenFile(LPCWSTR szFileName);
diff --git a/programs/notepad/main.c b/programs/notepad/main.c
index c195668..7e33372 100644
--- a/programs/notepad/main.c
+++ b/programs/notepad/main.c
@@ -698,7 +698,8 @@ static void HandleCommandLine(LPWSTR cmdline)
{
switch (AlertFileDoesNotExist(file_name)) {
case IDYES:
- DoOpenFile(file_name);
+ SetFileName(file_name);
+ UpdateWindowCaption();
break;
case IDNO:
More information about the wine-cvs
mailing list