Implement a change suggested by Archie Cobbs - the seekto argument should

be zero'd only if the operation *fails*, indicating that the file
starting offset is effectively zero.  This makes more sense.
This commit is contained in:
jkh 1996-08-21 01:23:33 +00:00
parent fc1487cdb0
commit 8a29a23657
2 changed files with 4 additions and 3 deletions

View File

@ -113,7 +113,7 @@ as a restart point for the file, that is to say that the stream
returned will point
.Fa *seekto
bytes into the file gotten (this is handy for restarting failed
transfers efficiently). If the seek operation succeeds, the value
transfers efficiently). If the seek operation fails, the value
of
.Fa *seekto
will be zero'd.

View File

@ -14,7 +14,7 @@
* Turned inside out. Now returns xfers as new file ids, not as a special
* `state' of FTP_t
*
* $Id: ftpio.c,v 1.9 1996/08/03 11:58:53 jkh Exp $
* $Id: ftpio.c,v 1.10 1996/08/21 01:12:10 jkh Exp $
*
*/
@ -676,9 +676,10 @@ ftp_file_op(FTP_t ftp, char *operation, char *file, FILE **fp, char *mode, int *
if (i < 0 || FTP_TIMEOUT(i)) {
close(s);
ftp->errno = i;
*seekto = 0;
return i;
}
else if (i != 350)
else if (i == 350)
*seekto = 0;
}
i = cmd(ftp, "%s %s", operation, file);