Piotr Caban : msvcrt: Fixed locale matching code.

Alexandre Julliard julliard at winehq.org
Tue Dec 18 13:49:06 CST 2012


Module: wine
Branch: master
Commit: a406d538bbeaab392e64d43088e8a2572818cff7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a406d538bbeaab392e64d43088e8a2572818cff7

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Dec 18 11:39:00 2012 +0100

msvcrt: Fixed locale matching code.

---

 dlls/msvcrt/locale.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index 707b8f1..4540e9a 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -130,9 +130,12 @@ static int compare_info(LCID lcid, DWORD flags, char* buff, const char* cmp, BOO
 {
   int len;
 
+  if(!cmp[0])
+      return 0;
+
   buff[0] = 0;
   GetLocaleInfoA(lcid, flags|LOCALE_NOUSEROVERRIDE, buff, MAX_ELEM_LEN);
-  if (!buff[0] || !cmp[0])
+  if (!buff[0])
     return 0;
 
   /* Partial matches are only allowed on language/country names */
@@ -175,7 +178,7 @@ find_best_locale_proc(HMODULE hModule, LPCSTR type, LPCSTR name, WORD LangID, LO
     TRACE("Found country:%s->%s\n", res->search_country, buff);
     flags |= FOUND_COUNTRY;
   }
-  else if (res->match_flags & FOUND_COUNTRY)
+  else if (!flags && (res->match_flags & FOUND_COUNTRY))
   {
     return CONTINUE_LOOKING;
   }
@@ -188,7 +191,7 @@ find_best_locale_proc(HMODULE hModule, LPCSTR type, LPCSTR name, WORD LangID, LO
     flags |= FOUND_CODEPAGE;
     memcpy(res->found_codepage,res->search_codepage,MAX_ELEM_LEN);
   }
-  else if (res->match_flags & FOUND_CODEPAGE)
+  else if (!flags && (res->match_flags & FOUND_CODEPAGE))
   {
     return CONTINUE_LOOKING;
   }




More information about the wine-cvs mailing list