From 77191a38205105adbe14c64f86d14ded5986ffc4 Mon Sep 17 00:00:00 2001 From: arvidn Date: Tue, 22 May 2018 09:29:54 +0200 Subject: [PATCH] fix hidden attribute in file class --- src/file.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/file.cpp b/src/file.cpp index 32c711761..0db8f56eb 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1419,14 +1419,14 @@ namespace libtorrent TORRENT_ASSERT((mode & rw_mask) < sizeof(mode_array)/sizeof(mode_array[0])); open_mode_t const& m = mode_array[mode & rw_mask]; - DWORD a = attrib_array[(mode & attribute_mask) >> 12]; + DWORD const a = attrib_array[(mode & attribute_mask) >> 9]; // one might think it's a good idea to pass in FILE_FLAG_RANDOM_ACCESS. It // turns out that it isn't. That flag will break your operating system: // http://support.microsoft.com/kb/2549369 DWORD flags = ((mode & random_access) ? 0 : FILE_FLAG_SEQUENTIAL_SCAN) - | (a ? a : FILE_ATTRIBUTE_NORMAL) + | a | FILE_FLAG_OVERLAPPED | ((mode & no_cache) ? FILE_FLAG_WRITE_THROUGH : 0);