Module: wine
Branch: master
Commit: ba43c67f8f54b256a7c509db68a7637ee432ad3a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ba43c67f8f54b256a7c509db6…
Author: Mikolaj Zalewski <mikolajz(a)google.com>
Date: Sun Aug 19 22:30:45 2007 -0700
msvcrt: Implement _ismbblead/_ismbbtrail using _mbctype (with tests).
---
dlls/msvcrt/mbcs.c | 6 ++----
dlls/msvcrt/tests/string.c | 8 ++++++--
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c
index f2c4d0c..1bbb32d 100644
--- a/dlls/msvcrt/mbcs.c
+++ b/dlls/msvcrt/mbcs.c
@@ -1056,8 +1056,7 @@ int CDECL _ismbckata(unsigned int c)
*/
int CDECL _ismbblead(unsigned int c)
{
- /* FIXME: should reference MSVCRT_mbctype */
- return MSVCRT_isleadbyte(c);
+ return (MSVCRT_mbctype[(c&0xff) + 1] & _M1) != 0;
}
@@ -1066,8 +1065,7 @@ int CDECL _ismbblead(unsigned int c)
*/
int CDECL _ismbbtrail(unsigned int c)
{
- /* FIXME: should reference MSVCRT_mbctype */
- return !_ismbblead(c);
+ return (MSVCRT_mbctype[(c&0xff) + 1] & _M2) != 0;
}
/*********************************************************************
diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c
index aa29703..6ac3fe2 100644
--- a/dlls/msvcrt/tests/string.c
+++ b/dlls/msvcrt/tests/string.c
@@ -161,7 +161,6 @@ void test_cp_table(int cp, int *result, int *todo)
static void test_mbcp(void)
{
- unsigned int s = '\354';
int mb_orig_max = __mb_cur_max;
int curr_mbcp = _getmbcp();
@@ -177,7 +176,12 @@ static void test_mbcp(void)
_setmbcp(936);
ok(__mb_cur_max == mb_orig_max, "__mb_cur_max shouldn't be updated (is %d != %d)\n", __mb_cur_max, mb_orig_max);
- todo_wine ok(_ismbblead(s), "got result %d\n", _ismbblead(s));
+ ok(_ismbblead('\354'), "\354 should be a lead byte\n");
+ ok(_ismbblead(' ') == FALSE, "' ' should not be a lead byte\n");
+ ok(_ismbblead(0x1234b0), "0x1234b0 should not be a lead byte\n");
+ ok(_ismbblead(0x123420) == FALSE, "0x123420 should not be a lead byte\n");
+ ok(_ismbbtrail('\xb0'), "\xa0 should be a trail byte\n");
+ ok(_ismbbtrail(' ') == FALSE, "' ' should not be a trail byte\n");
_setmbcp(curr_mbcp);
}
Module: wine
Branch: master
Commit: 87f119cfe05cb4b13eaea0732655a8270fdf5086
URL: http://source.winehq.org/git/wine.git/?a=commit;h=87f119cfe05cb4b13eaea0732…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com>
Date: Thu Aug 9 13:44:50 2007 +0900
kernel32: Fix test case failures for time zones with absolute transition dates.
---
dlls/kernel32/time.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/time.c b/dlls/kernel32/time.c
index 90af803..9aa9c69 100644
--- a/dlls/kernel32/time.c
+++ b/dlls/kernel32/time.c
@@ -101,7 +101,10 @@ static int TIME_DayLightCompareDate( const SYSTEMTIME *date,
if (date->wMonth > compareDate->wMonth)
return 1; /* We are in a month after the date limit. */
- if (compareDate->wDayOfWeek <= 6)
+ /* if year is 0 then date is in day-of-week format, otherwise
+ * it's absolute date.
+ */
+ if (compareDate->wYear == 0)
{
WORD First;
/* compareDate->wDay is interpreted as number of the week in the month
@@ -160,11 +163,14 @@ static DWORD TIME_CompTimeZoneID ( const TIME_ZONE_INFORMATION *pTZinfo,
if (pTZinfo->DaylightDate.wMonth != 0)
{
- if (pTZinfo->StandardDate.wMonth == 0 ||
- pTZinfo->StandardDate.wDay<1 ||
+ /* if year is 0 then date is in day-of-week format, otherwise
+ * it's absolute date.
+ */
+ if (pTZinfo->StandardDate.wYear == 0 &&
+ (pTZinfo->StandardDate.wDay<1 ||
pTZinfo->StandardDate.wDay>5 ||
pTZinfo->DaylightDate.wDay<1 ||
- pTZinfo->DaylightDate.wDay>5)
+ pTZinfo->DaylightDate.wDay>5))
{
SetLastError(ERROR_INVALID_PARAMETER);
return TIME_ZONE_ID_INVALID;