Commit 6cb12645 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

kernelbase: Get rid of the "size" and "type" arguments to scan_url().

parent b72f7afc
...@@ -74,11 +74,6 @@ struct parsed_url ...@@ -74,11 +74,6 @@ struct parsed_url
DWORD query_len; /* [out] size of Query (until eos) */ DWORD query_len; /* [out] size of Query (until eos) */
}; };
enum url_scan_type
{
SCHEME,
};
static WCHAR *heap_strdupAtoW(const char *str) static WCHAR *heap_strdupAtoW(const char *str)
{ {
WCHAR *ret = NULL; WCHAR *ret = NULL;
...@@ -4158,28 +4153,11 @@ HRESULT WINAPI UrlGetPartA(const char *url, char *out, DWORD *out_len, DWORD par ...@@ -4158,28 +4153,11 @@ HRESULT WINAPI UrlGetPartA(const char *url, char *out, DWORD *out_len, DWORD par
return hr; return hr;
} }
static const WCHAR * scan_url(const WCHAR *start, DWORD *size, enum url_scan_type type) static const WCHAR *parse_scheme( const WCHAR *p )
{ {
*size = 0; while ((*p >= 'a' && *p <= 'z') || (*p >= '0' && *p <= '9') || *p == '+' || *p == '-' || *p == '.')
++p;
switch (type) return p;
{
case SCHEME:
while ((isalnum( *start ) && !isupper( *start )) || *start == '+' || *start == '-' || *start == '.')
{
start++;
(*size)++;
}
if (*start != ':')
*size = 0;
break;
default:
FIXME("unknown type %d\n", type);
return L"";
}
return start;
} }
static const WCHAR *parse_url_element( const WCHAR *url, const WCHAR *separators ) static const WCHAR *parse_url_element( const WCHAR *url, const WCHAR *separators )
...@@ -4202,8 +4180,9 @@ static void parse_url( const WCHAR *url, struct parsed_url *pl ) ...@@ -4202,8 +4180,9 @@ static void parse_url( const WCHAR *url, struct parsed_url *pl )
memset(pl, 0, sizeof(*pl)); memset(pl, 0, sizeof(*pl));
pl->scheme = url; pl->scheme = url;
work = scan_url(pl->scheme, &pl->scheme_len, SCHEME); work = parse_scheme( pl->scheme );
if (!*work || (*work != ':')) return; if (*work != ':') return;
pl->scheme_len = work - pl->scheme;
work++; work++;
if (!is_slash( work[0] ) || !is_slash( work[1] )) if (!is_slash( work[0] ) || !is_slash( work[1] ))
return; return;
......
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