Author: cwittich
Date: Fri Nov 16 13:22:01 2007
New Revision: 30498
URL:
http://svn.reactos.org/svn/reactos?rev=30498&view=rev
Log:
fix some bugs in GetTimeZoneListIndex
Modified:
trunk/reactos/dll/win32/syssetup/wizard.c
Modified: trunk/reactos/dll/win32/syssetup/wizard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/wizard.…
==============================================================================
--- trunk/reactos/dll/win32/syssetup/wizard.c (original)
+++ trunk/reactos/dll/win32/syssetup/wizard.c Fri Nov 16 13:22:01 2007
@@ -1116,7 +1116,8 @@
LPTSTR Buffer;
LPTSTR Ptr;
LPTSTR End;
- BOOL bFound;
+ BOOL bFound = FALSE;
+ int iLanguageID;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
_T("SYSTEM\\CurrentControlSet\\Control\\NLS\\Language"),
@@ -1137,6 +1138,7 @@
return FALSE;
}
+ iLanguageID = _ttoi(szLanguageIdString);
RegCloseKey(hKey);
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
@@ -1183,22 +1185,21 @@
while (*Ptr != 0)
{
Length = _tcslen(Ptr);
- if (_tcsicmp(Ptr, szLanguageIdString) == 0)
+ if (_ttoi(Ptr) == iLanguageID)
bFound = TRUE;
Ptr = Ptr + Length + 1;
if (*Ptr == 0)
break;
- Length = _tcslen(Ptr);
-
if (bFound)
{
*lpIndex = _tcstoul(Ptr, &End, 10);
HeapFree(GetProcessHeap(), 0, Buffer);
- return FALSE;
- }
-
+ return TRUE;
+ }
+
+ Length = _tcslen(Ptr);
Ptr = Ptr + Length + 1;
}