mm_io_c: open MODE_CREATE files for reading and writing on Windows, too

mkvmerge's output file is opened in MODE_CREATE. This mode is supposed
to create the file if it doesn't exist, to truncate it otherwise and to
open it for writing. The fix for #1498 requires reading from the file,
too, and therefore the file must be opened for reading, too.

On non-Windows systems MODE_CREATE was already translated into opening
for reading and writing.
This commit is contained in:
Moritz Bunkus 2015-11-24 21:41:08 +01:00
parent 43cd756488
commit efe80d1f65

View File

@ -59,7 +59,7 @@ mm_file_io_c::mm_file_io_c(const std::string &path,
disposition = OPEN_ALWAYS;
break;
case MODE_CREATE:
access_mode = GENERIC_WRITE;
access_mode = GENERIC_WRITE | GENERIC_READ;
share_mode = FILE_SHARE_READ;
disposition = CREATE_ALWAYS;
break;