diff --git a/src/ChangeLog b/src/ChangeLog index 1a0457b0..d415ea99 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2001-11-19 Hrvoje Niksic + + * url.c (getproxy): Handle URL shorthands. + 2001-11-19 Hrvoje Niksic * main.c: Remove --wait / --waitretry backwards compatibility diff --git a/src/url.c b/src/url.c index 2159bb91..82b21d0c 100644 --- a/src/url.c +++ b/src/url.c @@ -1350,6 +1350,8 @@ char * getproxy (enum url_scheme scheme) { char *proxy = NULL; + char *rewritten_url; + static char rewritten_storage[1024]; switch (scheme) { @@ -1369,6 +1371,16 @@ getproxy (enum url_scheme scheme) } if (!proxy || !*proxy) return NULL; + + /* Handle shorthands. */ + rewritten_url = rewrite_url_maybe (proxy); + if (rewritten_url) + { + strncpy (rewritten_storage, rewritten_url, sizeof(rewritten_storage)); + rewritten_storage[sizeof (rewritten_storage) - 1] = '\0'; + proxy = rewritten_storage; + } + return proxy; }