From: YeshunYe yeyeshun@uniontech.com
Otherwise 'mbstowcs_s' will make a wrong path if the parameter 'name' contains non-ASCII words in non-ASCII environments.
Signed-off-by: YeshunYe yeyeshun@uniontech.com --- dlls/msvcp90/ios.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c index ef2c122f17f..37f23980c4c 100644 --- a/dlls/msvcp90/ios.c +++ b/dlls/msvcp90/ios.c @@ -25,6 +25,7 @@ #include "windef.h" #include "winbase.h" #include "winnls.h" +#include "locale.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvcp); @@ -3261,7 +3262,7 @@ FILE* __cdecl _Fiopen(const char *name, int mode, int prot) wchar_t nameW[FILENAME_MAX];
TRACE("(%s %d %d)\n", name, mode, prot); - + setlocale(LC_ALL, ""); if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0) return NULL; return _Fiopen_wchar(nameW, mode, prot);