summaryrefslogtreecommitdiff
path: root/usr.bin/ftp/main.c
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2007-11-26 12:39:01 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2007-11-26 12:39:01 +0000
commit03fc186892cc696b1dfd66f6501a24ea9d92c344 (patch)
treef8d667ae94d89d88e11e7edb17fabb23272615a1 /usr.bin/ftp/main.c
parent4445a4d33864c9d2da16d9fe6e7c5c03588a9f34 (diff)
implement -C for continuing ftp, http(s), and file transfers
ok millert@, pyr@
Diffstat (limited to 'usr.bin/ftp/main.c')
-rw-r--r--usr.bin/ftp/main.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index 1ddc702af5f..006607434d0 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.66 2007/09/05 08:04:49 moritz Exp $ */
+/* $OpenBSD: main.c,v 1.67 2007/11/26 12:39:00 martynas Exp $ */
/* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */
/*
@@ -66,7 +66,7 @@ static const char copyright[] =
#endif /* not lint */
#if !defined(lint) && !defined(SMALL)
-static const char rcsid[] = "$OpenBSD: main.c,v 1.66 2007/09/05 08:04:49 moritz Exp $";
+static const char rcsid[] = "$OpenBSD: main.c,v 1.67 2007/11/26 12:39:00 martynas Exp $";
#endif /* not lint and not SMALL */
/*
@@ -121,6 +121,7 @@ main(volatile int argc, char *argv[])
el = NULL;
hist = NULL;
cookiefile = NULL;
+ resume = 0;
#endif
mark = HASHBYTES;
marg_sl = sl_init();
@@ -181,7 +182,7 @@ main(volatile int argc, char *argv[])
cookiefile = getenv("http_cookies");
#endif
- while ((ch = getopt(argc, argv, "46Aac:dEegik:mno:pP:r:tvV")) != -1) {
+ while ((ch = getopt(argc, argv, "46AaCc:dEegik:mno:pP:r:tvV")) != -1) {
switch (ch) {
case '4':
family = PF_INET;
@@ -198,6 +199,12 @@ main(volatile int argc, char *argv[])
anonftp = 1;
break;
+ case 'C':
+#ifndef SMALL
+ resume = 1;
+#endif
+ break;
+
case 'c':
#ifndef SMALL
cookiefile = optarg;
@@ -757,7 +764,7 @@ void
usage(void)
{
(void)fprintf(stderr,
- "usage: %s [-46AadEegimnptVv] [-c cookie] [-k seconds] "
+ "usage: %s [-46AaCdEegimnptVv] [-c cookie] [-k seconds] "
"[-P port] [-r seconds]\n"
" [host [port]]\n"
" %s [-o output] ftp://[user:password@]host[:port]/file[/]\n"