Commit 698afdca authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Don't search for LCID in _setmbcp_l if it was already done.

parent df5d3e34
...@@ -842,7 +842,7 @@ MSVCRT__locale_t CDECL MSVCRT__create_locale(int category, const char *locale) ...@@ -842,7 +842,7 @@ MSVCRT__locale_t CDECL MSVCRT__create_locale(int category, const char *locale)
} }
} }
_setmbcp_l(loc->locinfo->lc_id[MSVCRT_LC_CTYPE].wCodePage, loc->mbcinfo); _setmbcp_l(loc->locinfo->lc_id[MSVCRT_LC_CTYPE].wCodePage, lcid[MSVCRT_LC_CTYPE], loc->mbcinfo);
if(lcid[MSVCRT_LC_MONETARY] && (category==MSVCRT_LC_ALL || category==MSVCRT_LC_MONETARY)) { if(lcid[MSVCRT_LC_MONETARY] && (category==MSVCRT_LC_ALL || category==MSVCRT_LC_MONETARY)) {
if(update_threadlocinfo_category(lcid[MSVCRT_LC_MONETARY], loc, MSVCRT_LC_MONETARY)) { if(update_threadlocinfo_category(lcid[MSVCRT_LC_MONETARY], loc, MSVCRT_LC_MONETARY)) {
......
...@@ -184,7 +184,7 @@ int* CDECL ___mb_cur_max_l_func(MSVCRT__locale_t locale) ...@@ -184,7 +184,7 @@ int* CDECL ___mb_cur_max_l_func(MSVCRT__locale_t locale)
/********************************************************************* /*********************************************************************
* INTERNAL: _setmbcp_l * INTERNAL: _setmbcp_l
*/ */
int _setmbcp_l(int cp, MSVCRT_pthreadmbcinfo mbcinfo) int _setmbcp_l(int cp, LCID lcid, MSVCRT_pthreadmbcinfo mbcinfo)
{ {
const char format[] = ".%d"; const char format[] = ".%d";
...@@ -222,8 +222,13 @@ int _setmbcp_l(int cp, MSVCRT_pthreadmbcinfo mbcinfo) ...@@ -222,8 +222,13 @@ int _setmbcp_l(int cp, MSVCRT_pthreadmbcinfo mbcinfo)
break; break;
} }
sprintf(bufA, format, newcp); if(lcid == -1) {
mbcinfo->mblcid = MSVCRT_locale_to_LCID(bufA); sprintf(bufA, format, newcp);
mbcinfo->mblcid = MSVCRT_locale_to_LCID(bufA);
} else {
mbcinfo->mblcid = lcid;
}
if(mbcinfo->mblcid == -1) if(mbcinfo->mblcid == -1)
{ {
WARN("Can't assign LCID to codepage (%d)\n", mbcinfo->mblcid); WARN("Can't assign LCID to codepage (%d)\n", mbcinfo->mblcid);
...@@ -347,7 +352,7 @@ int _setmbcp_l(int cp, MSVCRT_pthreadmbcinfo mbcinfo) ...@@ -347,7 +352,7 @@ int _setmbcp_l(int cp, MSVCRT_pthreadmbcinfo mbcinfo)
*/ */
int CDECL _setmbcp(int cp) int CDECL _setmbcp(int cp)
{ {
return _setmbcp_l(cp, NULL); return _setmbcp_l(cp, -1, NULL);
} }
/********************************************************************* /*********************************************************************
......
...@@ -888,7 +888,7 @@ MSVCRT_pthreadmbcinfo get_mbcinfo(void); ...@@ -888,7 +888,7 @@ MSVCRT_pthreadmbcinfo get_mbcinfo(void);
void __cdecl MSVCRT__free_locale(MSVCRT__locale_t); void __cdecl MSVCRT__free_locale(MSVCRT__locale_t);
void free_locinfo(MSVCRT_pthreadlocinfo); void free_locinfo(MSVCRT_pthreadlocinfo);
void free_mbcinfo(MSVCRT_pthreadmbcinfo); void free_mbcinfo(MSVCRT_pthreadmbcinfo);
int _setmbcp_l(int, MSVCRT_pthreadmbcinfo); int _setmbcp_l(int, LCID, MSVCRT_pthreadmbcinfo);
#ifndef __WINE_MSVCRT_TEST #ifndef __WINE_MSVCRT_TEST
int __cdecl MSVCRT__write(int,const void*,unsigned int); int __cdecl MSVCRT__write(int,const void*,unsigned int);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment