=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: cmd: Allow a batch file to delete itself.

Alexandre Julliard julliard at winehq.org
Mon Sep 12 11:43:00 CDT 2011


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

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Sun Sep 11 17:14:55 2011 +0200

cmd: Allow a batch file to delete itself.

---

 programs/cmd/batch.c                     |    2 +-
 programs/cmd/tests/test_builtins.cmd.exp |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c
index 70886d1..881c7d1 100644
--- a/programs/cmd/batch.c
+++ b/programs/cmd/batch.c
@@ -51,7 +51,7 @@ void WCMD_batch (WCHAR *file, WCHAR *command, int called, WCHAR *startLabel, HAN
   BATCH_CONTEXT *prev_context;
 
   if (startLabel == NULL) {
-    h = CreateFileW (file, GENERIC_READ, FILE_SHARE_READ,
+    h = CreateFileW (file, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
     if (h == INVALID_HANDLE_VALUE) {
       SetLastError (ERROR_FILE_NOT_FOUND);
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 5c022ff..b9285b1 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -725,7 +725,7 @@ foo ''
 non-builtin dir
 ------------ Testing cmd invocation ------------
 ... a batch file can delete itself ...
- at todo_wine@file correctly deleted
+file correctly deleted
 ... a batch file can alter itself ...
 @todo_wine at bar
 ------------ Testing setlocal/endlocal ------------




More information about the wine-cvs mailing list