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
bfa30458
Commit
bfa30458
authored
Apr 16, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added support for %W and %U format in strftime.
parent
34457aa4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
3 deletions
+39
-3
time.c
dlls/msvcrt/tests/time.c
+26
-0
time.c
dlls/msvcrt/time.c
+13
-3
No files found.
dlls/msvcrt/tests/time.c
View file @
bfa30458
...
...
@@ -704,6 +704,32 @@ static void test_strftime(void)
ok
(
retA
==
2
,
"expected 2, got %ld
\n
"
,
retA
);
ok
(
!
strcmp
(
bufA
,
"AM"
),
"got %s
\n
"
,
bufA
);
retA
=
strftime
(
bufA
,
256
,
"%U"
,
gmt_tm
);
ok
(
retA
==
2
,
"expected 2, got %ld
\n
"
,
retA
);
ok
(
!
strcmp
(
bufA
,
"00"
),
"got %s
\n
"
,
bufA
);
retA
=
strftime
(
bufA
,
256
,
"%W"
,
gmt_tm
);
ok
(
retA
==
2
,
"expected 2, got %ld
\n
"
,
retA
);
ok
(
!
strcmp
(
bufA
,
"00"
),
"got %s
\n
"
,
bufA
);
gmt_tm
->
tm_wday
=
0
;
retA
=
strftime
(
bufA
,
256
,
"%U"
,
gmt_tm
);
ok
(
retA
==
2
,
"expected 2, got %ld
\n
"
,
retA
);
ok
(
!
strcmp
(
bufA
,
"01"
),
"got %s
\n
"
,
bufA
);
retA
=
strftime
(
bufA
,
256
,
"%W"
,
gmt_tm
);
ok
(
retA
==
2
,
"expected 2, got %ld
\n
"
,
retA
);
ok
(
!
strcmp
(
bufA
,
"00"
),
"got %s
\n
"
,
bufA
);
gmt_tm
->
tm_yday
=
365
;
retA
=
strftime
(
bufA
,
256
,
"%U"
,
gmt_tm
);
ok
(
retA
==
2
,
"expected 2, got %ld
\n
"
,
retA
);
ok
(
!
strcmp
(
bufA
,
"53"
),
"got %s
\n
"
,
bufA
);
retA
=
strftime
(
bufA
,
256
,
"%W"
,
gmt_tm
);
ok
(
retA
==
2
,
"expected 2, got %ld
\n
"
,
retA
);
ok
(
!
strcmp
(
bufA
,
"52"
),
"got %s
\n
"
,
bufA
);
gmt_tm
->
tm_mon
=
1
;
gmt_tm
->
tm_mday
=
30
;
retA
=
strftime
(
bufA
,
256
,
"%c"
,
gmt_tm
);
...
...
dlls/msvcrt/time.c
View file @
bfa30458
...
...
@@ -1077,9 +1077,19 @@ MSVCRT_size_t CDECL _Strftime(char *str, MSVCRT_size_t max, const char *format,
break
;
case
'U'
:
case
'W'
:
FIXME
(
"format %c not yet supported (%x)
\n
"
,
*
format
,
alternate
);
str
[
0
]
=
0
;
return
0
;
if
(
mstm
->
tm_wday
<
0
||
mstm
->
tm_wday
>
6
||
mstm
->
tm_yday
<
0
||
mstm
->
tm_yday
>
365
)
goto
einval_error
;
if
(
*
format
==
'U'
)
tmp
=
mstm
->
tm_wday
;
else
if
(
!
mstm
->
tm_wday
)
tmp
=
6
;
else
tmp
=
mstm
->
tm_wday
-
1
;
tmp
=
mstm
->
tm_yday
/
7
+
(
tmp
<=
mstm
->
tm_yday
%
7
);
if
(
!
strftime_int
(
str
,
&
ret
,
max
,
tmp
,
alternate
?
0
:
2
,
0
,
53
))
return
0
;
break
;
case
'%'
:
str
[
ret
++
]
=
'%'
;
break
;
...
...
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