1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Allow all hex digits in IPv6 IP addresses.

Published in <sxsofjgvo72.fsf@florida.arsdigita.de>.
This commit is contained in:
hniksic 2002-01-26 12:43:17 -08:00
parent 774c7c7461
commit 1bea726393
2 changed files with 22 additions and 14 deletions

View File

@ -1,3 +1,8 @@
2002-01-26 Hrvoje Niksic <hniksic@arsdigita.com>
* url.c (url_parse): Allow all hex digits, not only decimal ones,
to form an IP address.
2002-01-26 Hrvoje Niksic <hniksic@arsdigita.com> 2002-01-26 Hrvoje Niksic <hniksic@arsdigita.com>
* url.c (urlchr_table): Make square braces reserved, so we can * url.c (urlchr_table): Make square braces reserved, so we can

View File

@ -704,20 +704,23 @@ url_parse (const char *url, int *error)
int invalid = 0; int invalid = 0;
++p; ++p;
while (1) while (1)
switch (*p++) {
{ char c = *p++;
case ']': switch (c)
goto out; {
case '\0': case ']':
SETERR (error, PE_UNTERMINATED_IPV6_ADDRESS); goto out;
return NULL; case '\0':
case '0': case '1': case '2': case '3': case '4': SETERR (error, PE_UNTERMINATED_IPV6_ADDRESS);
case '5': case '6': case '7': case '8': case '9': return NULL;
case ':': case '.': case ':': case '.':
break; break;
default: default:
invalid = 1; if (ISXDIGIT (c))
} break;
invalid = 1;
}
}
out: out:
if (invalid) if (invalid)
{ {