Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/networking/ftpgetput.c

    r2725 r3232  
    1414 */
    1515
     16//usage:#define ftpget_trivial_usage
     17//usage:       "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE"
     18//usage:#define ftpget_full_usage "\n\n"
     19//usage:       "Download a file via FTP\n"
     20//usage:    IF_FEATURE_FTPGETPUT_LONG_OPTIONS(
     21//usage:     "\n    -c,--continue       Continue previous transfer"
     22//usage:     "\n    -v,--verbose        Verbose"
     23//usage:     "\n    -u,--username USER  Username"
     24//usage:     "\n    -p,--password PASS  Password"
     25//usage:     "\n    -P,--port NUM       Port"
     26//usage:    )
     27//usage:    IF_NOT_FEATURE_FTPGETPUT_LONG_OPTIONS(
     28//usage:     "\n    -c  Continue previous transfer"
     29//usage:     "\n    -v  Verbose"
     30//usage:     "\n    -u USER Username"
     31//usage:     "\n    -p PASS Password"
     32//usage:     "\n    -P NUM  Port"
     33//usage:    )
     34//usage:
     35//usage:#define ftpput_trivial_usage
     36//usage:       "[OPTIONS] HOST [REMOTE_FILE] LOCAL_FILE"
     37//usage:#define ftpput_full_usage "\n\n"
     38//usage:       "Upload a file to a FTP server\n"
     39//usage:    IF_FEATURE_FTPGETPUT_LONG_OPTIONS(
     40//usage:     "\n    -v,--verbose        Verbose"
     41//usage:     "\n    -u,--username USER  Username"
     42//usage:     "\n    -p,--password PASS  Password"
     43//usage:     "\n    -P,--port NUM       Port"
     44//usage:    )
     45//usage:    IF_NOT_FEATURE_FTPGETPUT_LONG_OPTIONS(
     46//usage:     "\n    -v  Verbose"
     47//usage:     "\n    -u USER Username"
     48//usage:     "\n    -p PASS Password"
     49//usage:     "\n    -P NUM  Port number"
     50//usage:    )
     51
    1652#include "libbb.h"
    1753
     
    2359    int verbose_flag;
    2460    int do_continue;
    25     char buf[1]; /* actually [BUFSZ] */
     61    char buf[4]; /* actually [BUFSZ] */
    2662} FIX_ALIASING;
    2763#define G (*(struct globals*)&bb_common_bufsiz1)
     
    68104
    69105    do {
    70         strcpy(buf, "EOF");
     106        strcpy(buf, "EOF"); /* for ftp_die */
    71107        if (fgets(buf, BUFSZ - 2, control_stream) == NULL) {
    72108            ftp_die(NULL);
     
    152188    port_num += xatoul_range(buf_ptr + 1, 0, 255) * 256;
    153189
    154     set_nport(lsa, htons(port_num));
     190    set_nport(&lsa->u.sa, htons(port_num));
    155191    return xconnect_stream(lsa);
    156192}
     
    279315int ftpgetput_main(int argc UNUSED_PARAM, char **argv)
    280316{
    281     unsigned opt;
    282317    const char *port = "ftp";
    283318    /* socket to ftp server */
     
    308343#endif
    309344    opt_complementary = "-2:vv:cc"; /* must have 2 to 3 params; -v and -c count */
    310     opt = getopt32(argv, "cvu:p:P:", &user, &password, &port,
     345    getopt32(argv, "cvu:p:P:", &user, &password, &port,
    311346                    &verbose_flag, &do_continue);
    312347    argv += optind;
Note: See TracChangeset for help on using the changeset viewer.