André Hentschel : oleaut32: Fix year 0.
Alexandre Julliard
julliard at winehq.org
Thu Feb 4 11:10:59 CST 2010
Module: wine
Branch: master
Commit: 23ff47610e5044f8eebdc21a55728e14bca62537
URL: http://source.winehq.org/git/wine.git/?a=commit;h=23ff47610e5044f8eebdc21a55728e14bca62537
Author: André Hentschel <nerv at dawncrow.de>
Date: Wed Feb 3 19:24:06 2010 +0100
oleaut32: Fix year 0.
---
dlls/oleaut32/tests/vartest.c | 2 +-
dlls/oleaut32/variant.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c
index 34f0e3f..c5d65a2 100644
--- a/dlls/oleaut32/tests/vartest.c
+++ b/dlls/oleaut32/tests/vartest.c
@@ -1665,7 +1665,7 @@ static void test_VarDateFromUdate(void)
UD2T(1,12001,-1020,18,1,16,0,0,0,0,S_OK,29221.75087962963); /* Test rolled year and month */
UD2T(1,-23,1982,18,1,16,0,0,0,0,S_OK,29221.75087962963); /* Test backrolled month */
UD2T(-59,3,1980,18,1,16,0,0,0,0,S_OK,29221.75087962963); /* Test backrolled days */
- todo_wine UD2T(1,1,0,0,0,0,0,0,0,0,S_OK,36526); /* Test zero year */
+ UD2T(1,1,0,0,0,0,0,0,0,0,S_OK,36526); /* Test zero year */
UD2T(0,0,1980,0,0,0,0,0,0,0,S_OK,29189); /* Test zero day and month */
UD2T(0,1,1980,0,0,0,0,2,1,0,S_OK,29220.0); /* Test zero day = LastDayOfMonth */
UD2T(-1,1,1980,18,1,16,0,0,0,0,S_OK,29219.75087962963); /* Test day -1 = LastDayOfMonth - 1 */
diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c
index a2a5bd8..55d0935 100644
--- a/dlls/oleaut32/variant.c
+++ b/dlls/oleaut32/variant.c
@@ -1145,7 +1145,7 @@ static HRESULT VARIANT_RollUdate(UDATE *lpUd)
if (iYear > 9999 || iYear < -9999)
return E_INVALIDARG; /* Invalid value */
/* Years < 100 are treated as 1900 + year */
- if (iYear >= 0 && iYear < 100)
+ if (iYear > 0 && iYear < 100)
iYear += 1900;
iMinute += (iSecond - (iSecond % 60)) / 60;
@@ -1180,7 +1180,7 @@ static HRESULT VARIANT_RollUdate(UDATE *lpUd)
if (iSecond<0){iSecond+=60; iMinute--;}
if (iMinute<0){iMinute+=60; iHour--;}
if (iHour<0) {iHour+=24; iDay--;}
- if (iYear<0) iYear+=2000;
+ if (iYear<=0) iYear+=2000;
lpUd->st.wYear = iYear;
lpUd->st.wMonth = iMonth;
More information about the wine-cvs
mailing list