kernelbase: Allow schemes to contain uppercase characters in UrlGetPart().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6cb1264585
commit
91ae5ffe08
|
@ -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, ""},
|
||||
|
|
Loading…
Reference in New Issue