#1129. Fix submitted.

v0.27.3
Robin Mills 10 years ago
parent 81f0e43af4
commit abd5ecedd4

@ -229,7 +229,7 @@ namespace Exiv2 {
virtual bool isopen() const = 0;
//!Returns 0 if the IO source is in a valid state, otherwise nonzero.
virtual int error() const = 0;
//!Returns true if the IO position has reach the end, otherwise false.
//!Returns true if the IO position has reached the end, otherwise false.
virtual bool eof() const = 0;
/*!
@brief Return the path to the IO resource. Often used to form
@ -512,7 +512,7 @@ namespace Exiv2 {
virtual bool isopen() const;
//! Returns 0 if the file is in a valid state, otherwise nonzero.
virtual int error() const;
//! Returns true if the file position has reach the end, otherwise false.
//! Returns true if the file position has reached the end, otherwise false.
virtual bool eof() const;
//! Returns the path of the file
virtual std::string path() const;
@ -721,7 +721,7 @@ namespace Exiv2 {
virtual bool isopen() const;
//!Always returns 0
virtual int error() const;
//!Returns true if the IO position has reach the end, otherwise false.
//!Returns true if the IO position has reached the end, otherwise false.
virtual bool eof() const;
//! Returns a dummy path, indicating that memory access is used
virtual std::string path() const;
@ -1065,7 +1065,7 @@ namespace Exiv2 {
virtual bool isopen() const;
//!Always returns 0
virtual int error() const;
//!Returns true if the IO position has reach the end, otherwise false.
//!Returns true if the IO position has reached the end, otherwise false.
virtual bool eof() const;
//!Returns the URL of the file.
virtual std::string path() const;

@ -23,7 +23,7 @@ try {
Exiv2::DataBuf buf(io.size());
std::cout << "Reading " << buf.size_ << " bytes from " << data << "\n";
io.read(buf.pData_, buf.size_);
if (io.error() || io.eof()) throw Exiv2::Error(14);
if (io.error() || !io.eof()) throw Exiv2::Error(14);
// Read metadata from file
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(file);

@ -1064,7 +1064,7 @@ namespace Exiv2 {
bool FileIo::eof() const
{
assert(p_->fp_ != 0);
return feof(p_->fp_) != 0;
return feof(p_->fp_) != 0 || tell() >= size() ;
}
std::string FileIo::path() const

Loading…
Cancel
Save