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

[svn] Don't use the now-obsolete TYPE variable.

Published in <sxswv0ledyx.fsf@florida.arsdigita.de>.
This commit is contained in:
hniksic 2001-11-20 08:03:41 -08:00
parent 94c5b23136
commit a24b3d50f0
2 changed files with 19 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2001-11-20 Hrvoje Niksic <hniksic@arsdigita.com>
* url.c (parseurl): Don't depend on the now-obsolete TYPE.
2001-11-19 Hrvoje Niksic <hniksic@arsdigita.com> 2001-11-19 Hrvoje Niksic <hniksic@arsdigita.com>
* url.c (getproxy): Handle URL shorthands. * url.c (getproxy): Handle URL shorthands.

View File

@ -423,7 +423,7 @@ parseurl (const char *url, struct urlinfo *u, int strict)
the scheme was explicitly named, the scheme was explicitly named,
i.e. it wasn't deduced from the URL i.e. it wasn't deduced from the URL
format. */ format. */
uerr_t type; uerr_t type = URLUNKNOWN;
DEBUGP (("parseurl (\"%s\") -> ", url)); DEBUGP (("parseurl (\"%s\") -> ", url));
recognizable = url_has_scheme (url); recognizable = url_has_scheme (url);
@ -442,7 +442,17 @@ parseurl (const char *url, struct urlinfo *u, int strict)
else if (i == ARRAY_SIZE (supported_schemes)) else if (i == ARRAY_SIZE (supported_schemes))
type = URLUNKNOWN; type = URLUNKNOWN;
else else
u->scheme = type = supported_schemes[i].scheme; {
u->scheme = supported_schemes[i].scheme;
if (u->scheme == SCHEME_HTTP)
type = URLHTTP;
#ifdef HAVE_SSL
if (u->scheme == SCHEME_HTTPS)
type = URLHTTPS;
#endif
if (u->scheme == SCHEME_FTP)
type = URLFTP;
}
if (type == URLUNKNOWN) if (type == URLUNKNOWN)
l = 0; l = 0;
@ -505,12 +515,12 @@ parseurl (const char *url, struct urlinfo *u, int strict)
/* Some delimiter troubles... */ /* Some delimiter troubles... */
if (url[i] == '/' && url[i - 1] != ':') if (url[i] == '/' && url[i - 1] != ':')
++i; ++i;
if (type == URLHTTP) if (u->scheme == SCHEME_HTTP)
while (url[i] && url[i] == '/') while (url[i] && url[i] == '/')
++i; ++i;
u->path = (char *)xmalloc (strlen (url + i) + 8); u->path = (char *)xmalloc (strlen (url + i) + 8);
strcpy (u->path, url + i); strcpy (u->path, url + i);
if (type == URLFTP) if (u->scheme == SCHEME_FTP)
{ {
u->ftp_type = process_ftp_type (u->path); u->ftp_type = process_ftp_type (u->path);
/* #### We don't handle type `d' correctly yet. */ /* #### We don't handle type `d' correctly yet. */
@ -534,7 +544,7 @@ parseurl (const char *url, struct urlinfo *u, int strict)
/* Simplify the directory. */ /* Simplify the directory. */
path_simplify (u->dir); path_simplify (u->dir);
/* Remove the leading `/' in HTTP. */ /* Remove the leading `/' in HTTP. */
if (type == URLHTTP && *u->dir == '/') if (u->scheme == SCHEME_HTTP && *u->dir == '/')
strcpy (u->dir, u->dir + 1); strcpy (u->dir, u->dir + 1);
DEBUGP (("ndir %s\n", u->dir)); DEBUGP (("ndir %s\n", u->dir));
/* Strip trailing `/'. */ /* Strip trailing `/'. */