Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7b66e1ae
Commit
7b66e1ae
authored
May 07, 2010
by
André Hentschel
Committed by
Alexandre Julliard
May 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Check if the delimiter is a date delimiter.
parent
1ee497ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
18 deletions
+17
-18
vartype.c
dlls/oleaut32/tests/vartype.c
+4
-0
vartype.c
dlls/oleaut32/vartype.c
+13
-18
No files found.
dlls/oleaut32/tests/vartype.c
View file @
7b66e1ae
...
...
@@ -3436,10 +3436,14 @@ static void test_VarDateFromStr(void)
/* Native fails "1999 January 3, 9AM". I consider that a bug in native */
/* test a non-english data string */
DFS
(
"02.01.1970"
);
EXPECT_MISMATCH
;
DFS
(
"02.01.1970 00:00:00"
);
EXPECT_MISMATCH
;
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_GERMAN
,
SUBLANG_GERMAN
),
SORT_DEFAULT
);
DFS
(
"02.01.1970"
);
EXPECT_DBL
(
25570
.
0
);
DFS
(
"02.01.1970 00:00:00"
);
EXPECT_DBL
(
25570
.
0
);
lcid
=
MAKELCID
(
MAKELANGID
(
LANG_SPANISH
,
SUBLANG_SPANISH
),
SORT_DEFAULT
);
DFS
(
"02.01.1970"
);
EXPECT_MISMATCH
;
DFS
(
"02.01.1970 00:00:00"
);
EXPECT_MISMATCH
;
}
static
void
test_VarDateCopy
(
void
)
...
...
dlls/oleaut32/vartype.c
View file @
7b66e1ae
...
...
@@ -7426,7 +7426,8 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
LOCALE_SABBREVDAYNAME1
,
LOCALE_SABBREVDAYNAME2
,
LOCALE_SABBREVDAYNAME3
,
LOCALE_SABBREVDAYNAME4
,
LOCALE_SABBREVDAYNAME5
,
LOCALE_SABBREVDAYNAME6
,
LOCALE_SABBREVDAYNAME7
,
LOCALE_S1159
,
LOCALE_S2359
LOCALE_S1159
,
LOCALE_S2359
,
LOCALE_SDATE
};
static
const
BYTE
ParseDateMonths
[]
=
{
...
...
@@ -7498,7 +7499,7 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
dp
.
dwFlags
[
dp
.
dwCount
]
|=
(
DP_MONTH
|
DP_DATESEP
);
dp
.
dwCount
++
;
}
else
if
(
i
>
39
)
else
if
(
i
>
39
&&
i
<
42
)
{
if
(
!
dp
.
dwCount
||
dp
.
dwParseFlags
&
(
DP_AM
|
DP_PM
))
hRet
=
DISP_E_TYPEMISMATCH
;
...
...
@@ -7545,7 +7546,16 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
if
(
!
dp
.
dwCount
||
!
strIn
[
1
])
hRet
=
DISP_E_TYPEMISMATCH
;
else
dp
.
dwFlags
[
dp
.
dwCount
-
1
]
|=
DP_TIMESEP
;
if
(
tokens
[
42
][
0
]
==
*
strIn
)
{
dwDateSeps
++
;
if
(
dwDateSeps
>
2
)
hRet
=
DISP_E_TYPEMISMATCH
;
else
dp
.
dwFlags
[
dp
.
dwCount
-
1
]
|=
DP_DATESEP
;
}
else
dp
.
dwFlags
[
dp
.
dwCount
-
1
]
|=
DP_TIMESEP
;
}
else
if
(
*
strIn
==
'-'
||
*
strIn
==
'/'
)
{
...
...
@@ -7607,14 +7617,6 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
break
;
case
0x3
:
/* TTT TTTDD TTTDDD */
if
(
iDate
&&
dp
.
dwCount
==
3
)
{
/* DDD */
if
((
dp
.
dwFlags
[
0
]
&
(
DP_AM
|
DP_PM
))
||
(
dp
.
dwFlags
[
1
]
&
(
DP_AM
|
DP_PM
))
||
(
dp
.
dwFlags
[
2
]
&
(
DP_AM
|
DP_PM
)))
hRet
=
DISP_E_TYPEMISMATCH
;
break
;
}
if
(
dp
.
dwCount
>
4
&&
((
dp
.
dwFlags
[
3
]
&
(
DP_AM
|
DP_PM
))
||
(
dp
.
dwFlags
[
4
]
&
(
DP_AM
|
DP_PM
))
||
(
dp
.
dwFlags
[
5
]
&
(
DP_AM
|
DP_PM
))))
...
...
@@ -7707,13 +7709,6 @@ HRESULT WINAPI VarDateFromStr(OLECHAR* strIn, LCID lcid, ULONG dwFlags, DATE* pd
dp
.
dwCount
-=
3
;
break
;
case
0x1B
:
/* localized DDDTTT */
if
(
!
iDate
)
{
hRet
=
DISP_E_TYPEMISMATCH
;
break
;
}
/* .. fall through .. */
case
0x18
:
/* DDDTTT */
if
((
dp
.
dwFlags
[
0
]
&
(
DP_AM
|
DP_PM
))
||
(
dp
.
dwFlags
[
1
]
&
(
DP_AM
|
DP_PM
))
||
(
dp
.
dwFlags
[
2
]
&
(
DP_AM
|
DP_PM
)))
...
...
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