msvcrt: Implement %h format for strftime.
Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com> Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6ad18ca33a
commit
8e1435ef81
|
@ -628,6 +628,11 @@ static void test_strftime(void)
|
|||
ok(retA == 0, "expected 0, got %ld\n", retA);
|
||||
ok(errno==EINVAL || broken(errno==0xdeadbeef), "errno = %d\n", errno);
|
||||
|
||||
errno = 0xdeadbeef;
|
||||
retA = p_strftime(bufA, 256, "%h", gmt_tm);
|
||||
ok(retA == 0, "expected 0, got %ld\n", retA);
|
||||
ok(errno==EINVAL || broken(errno==0xdeadbeef), "errno = %d\n", errno);
|
||||
|
||||
errno = 0xdeadbeef;
|
||||
retA = p_strftime(bufA, 256, "%R", gmt_tm);
|
||||
ok(retA == 0, "expected 0, got %ld\n", retA);
|
||||
|
|
|
@ -1142,6 +1142,9 @@ static MSVCRT_size_t strftime_helper(char *str, MSVCRT_size_t max, const char *f
|
|||
return 0;
|
||||
break;
|
||||
case 'b':
|
||||
#if _MSVCR_VER>=140
|
||||
case 'h':
|
||||
#endif
|
||||
if(mstm->tm_mon<0 || mstm->tm_mon>11)
|
||||
goto einval_error;
|
||||
if(!strftime_str(str, &ret, max, time_data->str.names.short_mon[mstm->tm_mon]))
|
||||
|
|
|
@ -938,6 +938,10 @@ static void test_strftime(void)
|
|||
retA = p_strftime(bufA, sizeof(bufA), "%#T", &epoch);
|
||||
ok(retA == 5, "expected 5, got %d\n", (int)retA);
|
||||
ok(!strcmp(bufA, "0:0:0"), "got %s\n", bufA);
|
||||
|
||||
retA = p_strftime(bufA, sizeof(bufA), "%h", &epoch);
|
||||
ok(retA == 3, "expected 3, got %d\n", (int)retA);
|
||||
ok(!strcmp(bufA, "Jan"), "got %s\n", bufA);
|
||||
}
|
||||
|
||||
static LONG* get_failures_counter(HANDLE *map)
|
||||
|
|
Loading…
Reference in New Issue