aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2009-11-03 14:17:55 +0000
committerVincent Richard <[email protected]>2009-11-03 14:17:55 +0000
commit63d6a2ac5a77dbf0cabf11b5a74ad25b1e7112a2 (patch)
tree1406263f978da08a8485b6fe8ab1ff1df15eb8c0
parentFixed possible segfault (thanks to László Vadócz). (diff)
downloadvmime-63d6a2ac5a77dbf0cabf11b5a74ad25b1e7112a2.tar.gz
vmime-63d6a2ac5a77dbf0cabf11b5a74ad25b1e7112a2.zip
Reset EOF flag when stream is reset.
-rw-r--r--src/platforms/posix/posixFile.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/platforms/posix/posixFile.cpp b/src/platforms/posix/posixFile.cpp
index 4ec2ef32..7ee9f197 100644
--- a/src/platforms/posix/posixFile.cpp
+++ b/src/platforms/posix/posixFile.cpp
@@ -188,6 +188,8 @@ void posixFileReaderInputStream::reset()
{
if (::lseek(m_fd, 0, SEEK_SET) == off_t(-1))
posixFileSystemFactory::reportError(m_path, errno);
+
+ m_eof = false;
}
@@ -199,7 +201,7 @@ vmime::utility::stream::size_type posixFileReaderInputStream::read
if ((c = ::read(m_fd, data, count)) == -1)
posixFileSystemFactory::reportError(m_path, errno);
- if (c == 0)
+ if (c == 0 && count != 0)
m_eof = true;
return static_cast <size_type>(c);