diff options
-rw-r--r-- | usr.bin/ftp/fetch.c | 6 | ||||
-rw-r--r-- | usr.bin/ftp/main.c | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c index 9af36730408..be548efe7b1 100644 --- a/usr.bin/ftp/fetch.c +++ b/usr.bin/ftp/fetch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fetch.c,v 1.87 2009/05/10 21:45:52 martynas Exp $ */ +/* $OpenBSD: fetch.c,v 1.88 2009/06/04 20:58:34 martynas Exp $ */ /* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */ /*- @@ -1009,7 +1009,9 @@ bad_ftp_url: xargc = 3; } oautologin = autologin; - if (username != NULL) + if (username == NULL) + anonftp = 1; /* Handle "automatic" transfers. */ + else autologin = 0; setpeer(xargc, xargv); autologin = oautologin; diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index 7f53dc531b1..97586f92226 100644 --- a/usr.bin/ftp/main.c +++ b/usr.bin/ftp/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.77 2009/05/05 19:35:30 martynas Exp $ */ +/* $OpenBSD: main.c,v 1.78 2009/06/04 20:58:34 martynas Exp $ */ /* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */ /* @@ -314,7 +314,6 @@ main(volatile int argc, char *argv[]) if (argc > 0) { if (isurl(argv[0])) { - anonftp = 1; /* Handle "automatic" transfers. */ rval = auto_fetch(argc, argv, outfile); if (rval >= 0) /* -1 == connected and cd-ed */ exit(rval); |