diff options
Diffstat (limited to 'wget.c')
-rw-r--r-- | wget.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -52,6 +52,7 @@ int wget_main(int argc, char **argv) | |||
52 | { | 52 | { |
53 | FILE *sfp; /* socket to web server */ | 53 | FILE *sfp; /* socket to web server */ |
54 | char *uri_host, *uri_path; /* parsed from command line url */ | 54 | char *uri_host, *uri_path; /* parsed from command line url */ |
55 | char *proxy; | ||
55 | int uri_port; | 56 | int uri_port; |
56 | char *s, buf[512]; | 57 | char *s, buf[512]; |
57 | int n; | 58 | int n; |
@@ -101,10 +102,20 @@ int wget_main(int argc, char **argv) | |||
101 | 102 | ||
102 | if (do_continue && !fname_out) | 103 | if (do_continue && !fname_out) |
103 | error_msg_and_die("cannot specify continue (-c) without a filename (-O)\n"); | 104 | error_msg_and_die("cannot specify continue (-c) without a filename (-O)\n"); |
105 | |||
104 | /* | 106 | /* |
105 | * Parse url into components. | 107 | * Use the proxy if necessary. |
106 | */ | 108 | */ |
107 | parse_url(argv[optind], &uri_host, &uri_port, &uri_path); | 109 | if ((proxy = getenv("http_proxy")) != NULL) { |
110 | proxy = xstrdup(proxy); | ||
111 | parse_url(proxy, &uri_host, &uri_port, &uri_path); | ||
112 | uri_path = argv[optind]; | ||
113 | } else { | ||
114 | /* | ||
115 | * Parse url into components. | ||
116 | */ | ||
117 | parse_url(argv[optind], &uri_host, &uri_port, &uri_path); | ||
118 | } | ||
108 | 119 | ||
109 | /* | 120 | /* |
110 | * Open socket to server. | 121 | * Open socket to server. |
@@ -475,7 +486,7 @@ progressmeter(int flag) | |||
475 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 486 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
476 | * SUCH DAMAGE. | 487 | * SUCH DAMAGE. |
477 | * | 488 | * |
478 | * $Id: wget.c,v 1.10 2000/12/07 19:56:48 markw Exp $ | 489 | * $Id: wget.c,v 1.11 2000/12/07 22:42:11 andersen Exp $ |
479 | */ | 490 | */ |
480 | 491 | ||
481 | 492 | ||