[PATCH v5 0/2] MR1989: wininet: Allow UTC as a timezone.
this should fix ubisoft connect outputting unknown timezone UTC in logs -- v5: wininet/tests: Add test for UTC timezone. https://gitlab.winehq.org/wine/wine/-/merge_requests/1989
From: Etaash Mathamsetty <etaash.mathamsetty(a)gmail.com> --- dlls/wininet/tests/internet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c index 04b7f1041f7..176cfcc8961 100644 --- a/dlls/wininet/tests/internet.c +++ b/dlls/wininet/tests/internet.c @@ -916,9 +916,11 @@ static void test_InternetTimeToSystemTime(void) test_data[] = { { "Fri, 07 Jan 2005 12:06:35 GMT", &expect1, TRUE }, + { "Fri, 07 Jan 2005 12:06:35 UTC", &expect1, TRUE }, { " fri, 7 jan 2005 12 06 35", &expect1, TRUE }, { "Fri, 07-01-2005 12:06:35", &expect1, TRUE }, { "5, 07-01-2005 12:06:35 GMT", &expect1, TRUE }, + { "5, 07-01-2005 12:06:35 UTC", &expect1, TRUE }, { "5, 07-01-2005 12:06:35 GMT;", &expect1, TRUE }, { "5, 07-01-2005 12:06:35 GMT123", &expect1, TRUE }, { "2, 11 01 2022 11 13 05", &expect2, TRUE }, -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1989
From: Etaash Mathamsetty <etaash.mathamsetty(a)gmail.com> --- dlls/wininet/http.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index b42f823208c..6c722d7e9df 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -4432,7 +4432,7 @@ static BOOL HTTP_ParseDateAsAsctime(LPCWSTR value, FILETIME *ft) /* asctime() doesn't report a timezone, but some web servers do, so accept * with or without GMT. */ - if (*ptr && wcscmp(ptr, L"GMT")) + if (*ptr && (wcscmp(ptr, L"GMT") && wcscmp(ptr, L"UTC"))) { ERR("unexpected timezone %s\n", debugstr_w(ptr)); return FALSE; @@ -4509,7 +4509,7 @@ static BOOL HTTP_ParseRfc1123Date(LPCWSTR value, FILETIME *ft) while (iswspace(*ptr)) ptr++; - if (wcscmp(ptr, L"GMT")) + if (wcscmp(ptr, L"GMT") && wcscmp(ptr, L"UTC")) { ERR("unexpected time zone %s\n", debugstr_w(ptr)); return FALSE; @@ -4626,7 +4626,7 @@ static BOOL HTTP_ParseRfc850Date(LPCWSTR value, FILETIME *ft) while (iswspace(*ptr)) ptr++; - if (wcscmp(ptr, L"GMT")) + if (wcscmp(ptr, L"GMT") && wcscmp(ptr, L"UTC")) { ERR("unexpected time zone %s\n", debugstr_w(ptr)); return FALSE; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1989
v3: modify test to use a better test -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1989#note_21305
participants (2)
-
Etaash Mathamsetty -
Etaash Mathamsetty (@etaash.mathamsetty)