James Hawkins : kernel32: Don't try to load an empty initialization file.
Alexandre Julliard
julliard at winehq.org
Tue Mar 24 09:01:56 CDT 2009
Module: wine
Branch: master
Commit: 87847b47cd5e4a31a7bbe8ba9f16aa0d70365562
URL: http://source.winehq.org/git/wine.git/?a=commit;h=87847b47cd5e4a31a7bbe8ba9f16aa0d70365562
Author: James Hawkins <truiken at gmail.com>
Date: Sun Mar 22 14:37:54 2009 -0700
kernel32: Don't try to load an empty initialization file.
---
dlls/kernel32/profile.c | 2 +-
dlls/kernel32/tests/profile.c | 5 +----
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c
index 22cc445..5d563a5 100644
--- a/dlls/kernel32/profile.c
+++ b/dlls/kernel32/profile.c
@@ -322,7 +322,7 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding)
TRACE("%p\n", hFile);
dwFileSize = GetFileSize(hFile, NULL);
- if (dwFileSize == INVALID_FILE_SIZE)
+ if (dwFileSize == INVALID_FILE_SIZE || dwFileSize == 0)
return NULL;
buffer_base = HeapAlloc(GetProcessHeap(), 0 , dwFileSize);
diff --git a/dlls/kernel32/tests/profile.c b/dlls/kernel32/tests/profile.c
index 9f5398c..7b57699 100644
--- a/dlls/kernel32/tests/profile.c
+++ b/dlls/kernel32/tests/profile.c
@@ -865,10 +865,7 @@ static void test_WritePrivateProfileString(void)
"key=string\r\n";
ret = WritePrivateProfileStringA("", "key", "string", path);
ok(ret == TRUE, "Expected TRUE, got %d\n", ret);
- todo_wine
- {
- ok(check_file_data(path, data), "File doesn't match\n");
- }
+ ok(check_file_data(path, data), "File doesn't match\n");
DeleteFileA(path);
/* NULL lpKeyName */
More information about the wine-cvs
mailing list