Sebastian Lackner : notepad: New files should be created immediately.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Aug 25 09:38:01 CDT 2015


Module: wine
Branch: master
Commit: 8a730168196d45f4364473b93e73bd74ad4378ce
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8a730168196d45f4364473b93e73bd74ad4378ce

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Tue Aug 25 06:57:58 2015 +0200

notepad: New files should be created immediately.

---

 programs/notepad/main.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/programs/notepad/main.c b/programs/notepad/main.c
index 480f866..20e887b 100644
--- a/programs/notepad/main.c
+++ b/programs/notepad/main.c
@@ -702,9 +702,18 @@ static void HandleCommandLine(LPWSTR cmdline)
         {
             switch (AlertFileDoesNotExist(file_name)) {
             case IDYES:
+            {
+
+                HANDLE file;
                 SetFileNameAndEncoding(file_name, ENCODING_ANSI);
+
+                file = CreateFileW(file_name, GENERIC_WRITE, FILE_SHARE_WRITE,
+                                   NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+                if (file != INVALID_HANDLE_VALUE) CloseHandle(file);
+
                 UpdateWindowCaption();
                 break;
+            }
 
             case IDNO:
                 break;




More information about the wine-cvs mailing list