From 45317ef7f203a7fac6719c553828ab4c2fa630dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Tue, 20 Nov 2012 18:34:51 +0100 Subject: [PATCH] Revert "Fix opening of read-only files on Windows" This reverts commit ade8dc1a218e43c3909c4eede58f4e28e09da73a. --- taglib/toolkit/tfilestream.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/taglib/toolkit/tfilestream.cpp b/taglib/toolkit/tfilestream.cpp index 6077d705..52252023 100644 --- a/taglib/toolkit/tfilestream.cpp +++ b/taglib/toolkit/tfilestream.cpp @@ -58,16 +58,10 @@ namespace { { DWORD access = readOnly ? GENERIC_READ : (GENERIC_READ | GENERIC_WRITE); - HANDLE handle; if(wcslen(path) > 0) - handle = CreateFileW(path, access, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); + return CreateFileW(path, access, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); else - handle = CreateFileA(path, access, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - - if(handle == INVALID_HANDLE_VALUE) - handle = NULL; - - return handle; + return CreateFileA(path, access, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); } size_t fread(void *ptr, size_t size, size_t nmemb, HANDLE stream)