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
d6948bf3
Commit
d6948bf3
authored
Aug 10, 2016
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Add support for multibyte characters in _Strftime.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7dfb21a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
time.c
dlls/msvcrt/tests/time.c
+10
-0
time.c
dlls/msvcrt/time.c
+5
-0
No files found.
dlls/msvcrt/tests/time.c
View file @
d6948bf3
...
...
@@ -746,6 +746,16 @@ static void test_strftime(void)
ok
(
retA
==
17
,
"expected 17, got %ld
\n
"
,
retA
);
ok
(
!
strcmp
(
bufA
,
"02/30/70 00:00:00"
),
"got %s
\n
"
,
bufA
);
}
if
(
!
setlocale
(
LC_ALL
,
"Japanese_Japan.932"
))
{
win_skip
(
"Japanese_Japan.932 locale not available
\n
"
);
return
;
}
/* test with multibyte character */
retA
=
strftime
(
bufA
,
256
,
"
\x82
%c"
,
gmt_tm
);
ok
(
retA
==
3
,
"expected 3, got %ld
\n
"
,
retA
);
ok
(
!
strcmp
(
bufA
,
"
\x82
%c"
),
"got %s
\n
"
,
bufA
);
}
static
void
test_asctime
(
void
)
...
...
dlls/msvcrt/time.c
View file @
d6948bf3
...
...
@@ -1078,6 +1078,11 @@ MSVCRT_size_t CDECL _Strftime(char *str, MSVCRT_size_t max, const char *format,
for
(
ret
=
0
;
*
format
&&
ret
<
max
;
format
++
)
{
if
(
*
format
!=
'%'
)
{
if
(
MSVCRT_isleadbyte
((
unsigned
char
)
*
format
))
{
str
[
ret
++
]
=
*
(
format
++
);
if
(
ret
==
max
)
continue
;
if
(
!
str
[
ret
])
goto
einval_error
;
}
str
[
ret
++
]
=
*
format
;
continue
;
}
...
...
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