Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
cc37abb6
Commit
cc37abb6
authored
Apr 18, 2012
by
Daniel Lehman
Committed by
Alexandre Julliard
Apr 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Treat years 0 to 29 as 2000 to 2029 in VARIANT_RollUdate.
parent
5afde5f3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
vartest.c
dlls/oleaut32/tests/vartest.c
+4
-1
variant.c
dlls/oleaut32/variant.c
+5
-2
No files found.
dlls/oleaut32/tests/vartest.c
View file @
cc37abb6
...
...
@@ -1742,7 +1742,10 @@ static void test_SystemTimeToVariantTime(void)
ST2DT
(
2
,
1
,
1980
,
0
,
0
,
0
,
0
,
TRUE
,
29222
.
0
);
ST2DT
(
0
,
1
,
1980
,
0
,
0
,
0
,
0
,
TRUE
,
29220
.
0
);
/* Rolls back to 31 Dec 1899 */
ST2DT
(
1
,
13
,
1980
,
0
,
0
,
0
,
0
,
FALSE
,
29587
.
0
);
/* Fails on invalid month */
ST2DT
(
31
,
12
,
90
,
0
,
0
,
0
,
0
,
TRUE
,
33238
.
0
);
/* year < 100 is 1900+year! */
ST2DT
(
31
,
12
,
90
,
0
,
0
,
0
,
0
,
TRUE
,
33238
.
0
);
/* 30 <= year < 100 is 1900+year */
ST2DT
(
1
,
1
,
30
,
0
,
0
,
0
,
0
,
TRUE
,
10959
.
0
);
/* 30 <= year < 100 is 1900+year */
ST2DT
(
1
,
1
,
29
,
0
,
0
,
0
,
0
,
TRUE
,
47119
.
0
);
/* 0 <= year < 30 is 2000+year */
ST2DT
(
1
,
1
,
0
,
0
,
0
,
0
,
0
,
TRUE
,
36526
.
0
);
/* 0 <= year < 30 is 2000+year */
}
static
void
test_dt2st
(
int
line
,
double
dt
,
INT
r
,
WORD
d
,
WORD
m
,
WORD
y
,
...
...
dlls/oleaut32/variant.c
View file @
cc37abb6
...
...
@@ -1143,8 +1143,11 @@ 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
)
/* Year 0 to 29 are treated as 2000 + year */
if
(
iYear
>=
0
&&
iYear
<
30
)
iYear
+=
2000
;
/* Remaining years < 100 are treated as 1900 + year */
else
if
(
iYear
>=
30
&&
iYear
<
100
)
iYear
+=
1900
;
iMinute
+=
iSecond
/
60
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment