From 637c0772f7a1cdb08ff26e0added72470f6e392b Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 16 Mar 2014 10:05:53 +0000 Subject: wget: add fseek calls to make ftp work; enable ftpget/ftpput --- configs/mingw32_defconfig | 8 ++++---- networking/ftpgetput.c | 6 ++++++ networking/wget.c | 6 ++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/configs/mingw32_defconfig b/configs/mingw32_defconfig index 05d69109d..b0db59d21 100644 --- a/configs/mingw32_defconfig +++ b/configs/mingw32_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Busybox version: 1.23.0.git -# Wed Mar 12 20:11:13 2014 +# Sun Mar 16 09:56:30 2014 # CONFIG_HAVE_DOT_CONFIG=y # CONFIG_PLATFORM_POSIX is not set @@ -756,9 +756,9 @@ CONFIG_STRINGS=y # CONFIG_FTPD is not set # CONFIG_FEATURE_FTP_WRITE is not set # CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set -# CONFIG_FTPGET is not set -# CONFIG_FTPPUT is not set -# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set +CONFIG_FTPGET=y +CONFIG_FTPPUT=y +CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS=y # CONFIG_HOSTNAME is not set # CONFIG_HTTPD is not set # CONFIG_FEATURE_HTTPD_RANGES is not set diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c index 8283366cc..0670b2141 100644 --- a/networking/ftpgetput.c +++ b/networking/ftpgetput.c @@ -100,6 +100,9 @@ static int ftpcmd(const char *s1, const char *s2) fprintf(control_stream, (s2 ? "%s %s\r\n" : "%s %s\r\n"+3), s1, s2); fflush(control_stream); +#if ENABLE_PLATFORM_MINGW32 + fseek(control_stream, 0L, SEEK_CUR); +#endif } do { @@ -108,6 +111,9 @@ static int ftpcmd(const char *s1, const char *s2) ftp_die(NULL); } } while (!isdigit(buf[0]) || buf[3] != ' '); +#if ENABLE_PLATFORM_MINGW32 + fseek(control_stream, 0L, SEEK_CUR); +#endif buf[3] = '\0'; n = xatou(buf); diff --git a/networking/wget.c b/networking/wget.c index e68397693..f13ca1c74 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -258,11 +258,17 @@ static int ftpcmd(const char *s1, const char *s2, FILE *fp) fprintf(fp, "%s%s\r\n", s1, s2); fflush(fp); log_io("> %s%s", s1, s2); +#if ENABLE_PLATFORM_MINGW32 + fseek(fp, 0L, SEEK_CUR); +#endif } do { fgets_and_trim(fp); } while (!isdigit(G.wget_buf[0]) || G.wget_buf[3] != ' '); +#if ENABLE_PLATFORM_MINGW32 + fseek(fp, 0L, SEEK_CUR); +#endif G.wget_buf[3] = '\0'; result = xatoi_positive(G.wget_buf); -- cgit v1.2.3-55-g6feb