From 5515170d136dfd639b16b409434c5a182174315d Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Mon, 14 Jan 2013 10:24:18 +0100 Subject: [PATCH] msvcrt: Be less strict while parsing file open mode in fopen function. --- dlls/msvcrt/file.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 60af1a72e43..f0d0f7d2b50 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -1263,6 +1263,8 @@ static int msvcrt_get_flags(const MSVCRT_wchar_t* mode, int *open_flags, int* st TRACE("%s\n", debugstr_w(mode)); + while(*mode == ' ') mode++; + switch(*mode++) { case 'R': case 'r': @@ -1301,6 +1303,8 @@ static int msvcrt_get_flags(const MSVCRT_wchar_t* mode, int *open_flags, int* st break; case '+': case ' ': + case 'a': + case 'w': break; default: MSVCRT_INVALID_PMT(0, MSVCRT_EINVAL);