aboutsummaryrefslogtreecommitdiff
path: root/networking/wget.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-01-29 22:51:25 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-01-29 22:51:25 +0000
commitb6aae0f38194cd39960a898606ee65d4be93a895 (patch)
treeb73c92aefaf614291a71d05e9d28ca68f4ef021b /networking/wget.c
parenta41fdf331af344ecd3ec230a072857ea197e1890 (diff)
downloadbusybox-w32-b6aae0f38194cd39960a898606ee65d4be93a895.tar.gz
busybox-w32-b6aae0f38194cd39960a898606ee65d4be93a895.tar.bz2
busybox-w32-b6aae0f38194cd39960a898606ee65d4be93a895.zip
preparatory patch for -Wwrite-strings #2
Diffstat (limited to 'networking/wget.c')
-rw-r--r--networking/wget.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/networking/wget.c b/networking/wget.c
index 224e80dc0..7766bde88 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -26,7 +26,7 @@ struct host_info {
26static void parse_url(char *url, struct host_info *h); 26static void parse_url(char *url, struct host_info *h);
27static FILE *open_socket(len_and_sockaddr *lsa); 27static FILE *open_socket(len_and_sockaddr *lsa);
28static char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc); 28static char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc);
29static int ftpcmd(char *s1, char *s2, FILE *fp, char *buf); 29static int ftpcmd(const char *s1, const char *s2, FILE *fp, char *buf);
30 30
31/* Globals (can be accessed from signal handlers */ 31/* Globals (can be accessed from signal handlers */
32static off_t content_len; /* Content-length of the file */ 32static off_t content_len; /* Content-length of the file */
@@ -37,7 +37,7 @@ static off_t transferred; /* Number of bytes transferred so far */
37static int chunked; /* chunked transfer encoding */ 37static int chunked; /* chunked transfer encoding */
38#if ENABLE_FEATURE_WGET_STATUSBAR 38#if ENABLE_FEATURE_WGET_STATUSBAR
39static void progressmeter(int flag); 39static void progressmeter(int flag);
40static char *curfile; /* Name of current file being transferred */ 40static const char *curfile; /* Name of current file being transferred */
41static struct timeval start; /* Time a transfer started */ 41static struct timeval start; /* Time a transfer started */
42enum { 42enum {
43 STALLTIME = 5 /* Seconds when xfer considered "stalled" */ 43 STALLTIME = 5 /* Seconds when xfer considered "stalled" */
@@ -190,18 +190,18 @@ int wget_main(int argc, char **argv)
190 // Dirty hack. Needed because bb_get_last_path_component 190 // Dirty hack. Needed because bb_get_last_path_component
191 // will destroy trailing / by storing '\0' in last byte! 191 // will destroy trailing / by storing '\0' in last byte!
192 if (!last_char_is(target.path, '/')) { 192 if (!last_char_is(target.path, '/')) {
193 fname_out = 193 fname_out = bb_get_last_path_component(target.path);
194#if ENABLE_FEATURE_WGET_STATUSBAR 194#if ENABLE_FEATURE_WGET_STATUSBAR
195 curfile = 195 curfile = fname_out;
196#endif 196#endif
197 bb_get_last_path_component(target.path);
198 } 197 }
199 if (!fname_out || !fname_out[0]) { 198 if (!fname_out || !fname_out[0]) {
200 fname_out = 199 /* bb_get_last_path_component writes
200 * to last '/' only. We don't have one here... */
201 fname_out = (char*)"index.html";
201#if ENABLE_FEATURE_WGET_STATUSBAR 202#if ENABLE_FEATURE_WGET_STATUSBAR
202 curfile = 203 curfile = fname_out;
203#endif 204#endif
204 "index.html";
205 } 205 }
206 if (dir_prefix != NULL) 206 if (dir_prefix != NULL)
207 fname_out = concat_path_file(dir_prefix, fname_out); 207 fname_out = concat_path_file(dir_prefix, fname_out);
@@ -624,7 +624,7 @@ static char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc)
624 return hdrval; 624 return hdrval;
625} 625}
626 626
627static int ftpcmd(char *s1, char *s2, FILE *fp, char *buf) 627static int ftpcmd(const char *s1, const char *s2, FILE *fp, char *buf)
628{ 628{
629 int result; 629 int result;
630 if (s1) { 630 if (s1) {