Commit 91ae5ffe authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

kernelbase: Allow schemes to contain uppercase characters in UrlGetPart().

parent 6cb12645
......@@ -4155,7 +4155,7 @@ HRESULT WINAPI UrlGetPartA(const char *url, char *out, DWORD *out_len, DWORD par
static const WCHAR *parse_scheme( const WCHAR *p )
{
while ((*p >= 'a' && *p <= 'z') || (*p >= '0' && *p <= '9') || *p == '+' || *p == '-' || *p == '.')
while (isalnum( *p ) || *p == '+' || *p == '-' || *p == '.')
++p;
return p;
}
......@@ -4384,7 +4384,18 @@ HRESULT WINAPI UrlGetPartW(const WCHAR *url, WCHAR *out, DWORD *out_len, DWORD p
*out_len = size + 1;
return E_POINTER;
}
memcpy(out, addr, size*sizeof(WCHAR));
if (part == URL_PART_SCHEME)
{
unsigned int i;
for (i = 0; i < size; ++i)
out[i] = tolower( addr[i] );
}
else
{
memcpy( out, addr, size * sizeof(WCHAR) );
}
out[size] = 0;
*out_len = size;
}
......
......@@ -709,7 +709,7 @@ static void test_UrlGetPart(void)
{"file://c:\\index.htm", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_FALSE, ""},
{"file:some text", URL_PART_HOSTNAME, 0, S_FALSE, ""},
{"index.htm", URL_PART_HOSTNAME, 0, E_FAIL},
{"sChEmE-.+:", URL_PART_SCHEME, 0, S_OK, "scheme-.+", .todo_hr = TRUE},
{"sChEmE-.+:", URL_PART_SCHEME, 0, S_OK, "scheme-.+"},
{"scheme_:", URL_PART_SCHEME, 0, S_FALSE, ""},
{"scheme :", URL_PART_SCHEME, 0, S_FALSE, ""},
{"sch eme:", URL_PART_SCHEME, 0, S_FALSE, ""},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment