summaryrefslogtreecommitdiff
path: root/usr.bin/ftp/cmds.c
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2008-10-16 23:15:54 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2008-10-16 23:15:54 +0000
commitfe835a6c9c9a9258f094308cb1dbe43e2bd5c2fd (patch)
tree48b967b98969dcc3deab354204125c8c25322279 /usr.bin/ftp/cmds.c
parentab3e274196a1e98ea7275ad0b0ed2a41dfb753af (diff)
- resume http transfers [-C], if local file does not exist
- resume ftp transfers [-C, reget, mget], if local file does not exist ok theo
Diffstat (limited to 'usr.bin/ftp/cmds.c')
-rw-r--r--usr.bin/ftp/cmds.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/usr.bin/ftp/cmds.c b/usr.bin/ftp/cmds.c
index 75059c8fb0c..9804866ba9c 100644
--- a/usr.bin/ftp/cmds.c
+++ b/usr.bin/ftp/cmds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmds.c,v 1.66 2008/09/18 14:45:36 todd Exp $ */
+/* $OpenBSD: cmds.c,v 1.67 2008/10/16 23:15:53 martynas Exp $ */
/* $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $ */
/*
@@ -60,7 +60,7 @@
*/
#if !defined(lint) && !defined(SMALL)
-static const char rcsid[] = "$OpenBSD: cmds.c,v 1.66 2008/09/18 14:45:36 todd Exp $";
+static const char rcsid[] = "$OpenBSD: cmds.c,v 1.67 2008/10/16 23:15:53 martynas Exp $";
#endif /* not lint and not SMALL */
/*
@@ -524,7 +524,7 @@ void
reget(int argc, char *argv[])
{
- (void)getit(argc, argv, 1, "r+w");
+ (void)getit(argc, argv, 1, "a+w");
}
#endif /* !SMALL */
@@ -532,7 +532,7 @@ void
get(int argc, char *argv[])
{
- (void)getit(argc, argv, 0, restart_point ? "r+w" : "w" );
+ (void)getit(argc, argv, 0, restart_point ? "a+w" : "w" );
}
/*
@@ -596,11 +596,7 @@ usage:
ret = stat(argv[2], &stbuf);
if (restartit == 1) {
- if (ret < 0) {
- warn("local: %s", argv[2]);
- goto freegetit;
- }
- restart_point = stbuf.st_size;
+ restart_point = (ret < 0) ? 0 : stbuf.st_size;
} else {
if (ret == 0) {
time_t mtime;
@@ -784,7 +780,7 @@ out:
#endif /* !SMALL */
xargv[1] = cp;
(void)getit(xargc, xargv, restartit,
- (restartit == 1 || restart_point) ? "r+w" : "w");
+ (restartit == 1 || restart_point) ? "a+w" : "w");
if (!mflag && fromatty) {
if (confirm(argv[0], NULL))
mflag = 1;