diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-06-18 21:20:18 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-06-18 21:20:18 +0000 |
commit | a16a22e463d0264e4decce42a5903fbb765df260 (patch) | |
tree | 9149ab3efb644015cf2f57f18c82dc453c51bbd9 /usr.bin | |
parent | 9ebf9b2b726fed56b00562353733618c2bc07927 (diff) |
Change default transfer type from ascii to binary; closes PR 1626
Similar to patch from mpech@prosoft.org.lv
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ftp/util.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/usr.bin/ftp/util.c b/usr.bin/ftp/util.c index 8da19bfdfaa..c31d2ee5164 100644 --- a/usr.bin/ftp/util.c +++ b/usr.bin/ftp/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.24 2000/05/15 18:27:27 deraadt Exp $ */ +/* $OpenBSD: util.c,v 1.25 2001/06/18 21:20:17 millert Exp $ */ /* $NetBSD: util.c,v 1.12 1997/08/18 10:20:27 lukem Exp $ */ /* @@ -35,7 +35,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: util.c,v 1.24 2000/05/15 18:27:27 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: util.c,v 1.25 2001/06/18 21:20:17 millert Exp $"; #endif /* not lint */ /* @@ -138,12 +138,19 @@ setpeer(argc, argv) /* * Set up defaults for FTP. */ - (void)strcpy(typename, "ascii"), type = TYPE_A; - curtype = TYPE_A; (void)strcpy(formname, "non-print"), form = FORM_N; (void)strcpy(modename, "stream"), mode = MODE_S; (void)strcpy(structname, "file"), stru = STRU_F; (void)strcpy(bytename, "8"), bytesize = 8; + /* + * Set type to 0 (not specified by user), + * meaning binary by default, but don't bother + * telling server. We can use binary + * for text files unless changed by the user. + */ + (void)strcpy(typename, "binary"); + curtype = TYPE_A; + type = 0; if (autologin) (void)login(argv[1], NULL, NULL); @@ -177,14 +184,6 @@ setpeer(argc, argv) unix_proxy = 1; else unix_server = 1; - /* - * Set type to 0 (not specified by user), - * meaning binary by default, but don't bother - * telling server. We can use binary - * for text files unless changed by the user. - */ - type = 0; - (void)strcpy(typename, "binary"); if (overbose) fprintf(ttyout, "Using %s mode to transfer files.\n", typename); |