summaryrefslogtreecommitdiff
path: root/networking/wget.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
committerRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /networking/wget.c
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
downloadbusybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.bz2
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
Diffstat (limited to 'networking/wget.c')
-rw-r--r--networking/wget.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/networking/wget.c b/networking/wget.c
index 6565bb1f3..1b7555abc 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -7,9 +7,6 @@
7 */ 7 */
8 8
9#include "busybox.h" 9#include "busybox.h"
10#include <errno.h>
11#include <signal.h>
12#include <sys/ioctl.h>
13#include <getopt.h> 10#include <getopt.h>
14 11
15 12
@@ -221,7 +218,7 @@ int wget_main(int argc, char **argv)
221 if (use_proxy) { 218 if (use_proxy) {
222 proxy = getenv(target.is_ftp ? "ftp_proxy" : "http_proxy"); 219 proxy = getenv(target.is_ftp ? "ftp_proxy" : "http_proxy");
223 if (proxy && *proxy) { 220 if (proxy && *proxy) {
224 parse_url(bb_xstrdup(proxy), &server); 221 parse_url(xstrdup(proxy), &server);
225 } else { 222 } else {
226 use_proxy = 0; 223 use_proxy = 0;
227 } 224 }
@@ -263,7 +260,7 @@ int wget_main(int argc, char **argv)
263 output = stdout; 260 output = stdout;
264 quiet_flag = TRUE; 261 quiet_flag = TRUE;
265 } else { 262 } else {
266 output = bb_xfopen(fname_out, (do_continue ? "a" : "w")); 263 output = xfopen(fname_out, (do_continue ? "a" : "w"));
267 } 264 }
268 265
269 /* 266 /*
@@ -396,9 +393,9 @@ read_response:
396 } 393 }
397 if (strcasecmp(buf, "location") == 0) { 394 if (strcasecmp(buf, "location") == 0) {
398 if (s[0] == '/') 395 if (s[0] == '/')
399 target.path = bb_xstrdup(s+1); 396 target.path = xstrdup(s+1);
400 else { 397 else {
401 parse_url(bb_xstrdup(s), &target); 398 parse_url(xstrdup(s), &target);
402 if (use_proxy == 0) { 399 if (use_proxy == 0) {
403 server.host = target.host; 400 server.host = target.host;
404 server.port = target.port; 401 server.port = target.port;
@@ -419,7 +416,7 @@ read_response:
419 * FTP session 416 * FTP session
420 */ 417 */
421 if (! target.user) 418 if (! target.user)
422 target.user = bb_xstrdup("anonymous:busybox@"); 419 target.user = xstrdup("anonymous:busybox@");
423 420
424 sfp = open_socket(&s_in); 421 sfp = open_socket(&s_in);
425 if (ftpcmd(NULL, NULL, sfp, buf) != 220) 422 if (ftpcmd(NULL, NULL, sfp, buf) != 220)
@@ -556,7 +553,7 @@ void parse_url(char *url, struct host_info *h)
556 *sp++ = '\0'; 553 *sp++ = '\0';
557 h->path = sp; 554 h->path = sp;
558 } else 555 } else
559 h->path = bb_xstrdup(""); 556 h->path = xstrdup("");
560 557
561 up = strrchr(h->host, '@'); 558 up = strrchr(h->host, '@');
562 if (up != NULL) { 559 if (up != NULL) {