aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-05-26 11:22:11 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-05-26 11:27:35 +0200
commit188fb37801879bca59ee5153e154c306fa727ae2 (patch)
tree832f5d2d7c70f6ebc4028ce07d29634ba647799c
parent44fed3eb9bfc9af7f7ce191c6608f12d6f710631 (diff)
downloadlibssh-188fb37801879bca59ee5153e154c306fa727ae2.tar.gz
libssh-188fb37801879bca59ee5153e154c306fa727ae2.tar.xz
libssh-188fb37801879bca59ee5153e154c306fa727ae2.zip
sftp: Reset eof on seek operations.
This fixes bug #48. (cherry picked from commit c483418b8210bc47a765f6b0e0dc99aec63e80fd)
-rw-r--r--src/sftp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sftp.c b/src/sftp.c
index 7cf0042c..99798e78 100644
--- a/src/sftp.c
+++ b/src/sftp.c
@@ -2054,6 +2054,7 @@ int sftp_seek(sftp_file file, uint32_t new_offset) {
}
file->offset = new_offset;
+ file->eof = 0;
return 0;
}
@@ -2064,6 +2065,7 @@ int sftp_seek64(sftp_file file, uint64_t new_offset) {
}
file->offset = new_offset;
+ file->eof = 0;
return 0;
}
@@ -2080,6 +2082,7 @@ uint64_t sftp_tell64(sftp_file file) {
/* Rewinds the position of the file pointer to the beginning of the file.*/
void sftp_rewind(sftp_file file) {
file->offset = 0;
+ file->eof = 0;
}
/* code written by Nick */