Hans Leidekker : wininet: Delete local file on error in FtpGetFile.
Alexandre Julliard
julliard at winehq.org
Mon Jul 21 08:51:28 CDT 2008
Module: wine
Branch: master
Commit: b311cca552994e7b6c5f92d535b31704af9f9425
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b311cca552994e7b6c5f92d535b31704af9f9425
Author: Hans Leidekker <hans at meelstraat.net>
Date: Sat Jul 19 19:53:19 2008 +0200
wininet: Delete local file on error in FtpGetFile.
---
dlls/wininet/ftp.c | 1 +
dlls/wininet/tests/ftp.c | 2 --
2 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c
index f35929d..cb24782 100644
--- a/dlls/wininet/ftp.c
+++ b/dlls/wininet/ftp.c
@@ -1552,6 +1552,7 @@ static BOOL FTP_FtpGetFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszRemoteFile,
&iar, sizeof(INTERNET_ASYNC_RESULT));
}
+ if (!bSuccess) DeleteFileW(lpszNewFile);
return bSuccess;
}
diff --git a/dlls/wininet/tests/ftp.c b/dlls/wininet/tests/ftp.c
index 992bce9..34aa68f 100644
--- a/dlls/wininet/tests/ftp.c
+++ b/dlls/wininet/tests/ftp.c
@@ -259,7 +259,6 @@ static void test_getfile(HINTERNET hFtp, HINTERNET hConnect)
ok ( GetLastError() == ERROR_INTERNET_EXTENDED_ERROR,
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %d\n", GetLastError());
/* Currently Wine always creates the local file (even on failure) which is not correct, hence the test */
- todo_wine
ok (GetFileAttributesA("should_also_be_non_existing_deadbeef") == INVALID_FILE_ATTRIBUTES,
"Local file should not have been created\n");
@@ -280,7 +279,6 @@ static void test_getfile(HINTERNET hFtp, HINTERNET hConnect)
ok ( GetLastError() == ERROR_INTERNET_EXTENDED_ERROR,
"Expected ERROR_INTERNET_EXTENDED_ERROR, got %d\n", GetLastError());
/* Currently Wine always creates the local file (even on failure) which is not correct, hence the test */
- todo_wine
ok (GetFileAttributesA("should_also_be_non_existing_deadbeef") == INVALID_FILE_ATTRIBUTES,
"Local file should not have been created\n");
More information about the wine-cvs
mailing list