[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:37:42 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=2af57fb

The following commit has been merged in the master branch:
commit 2af57fb29db066c2c87167253367f1dba8c185c3
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Fri Jun 2 12:59:04 2006 +0000

    Fixed MemIo EOF behaviour to be similar to that of FILE*. Fixes bug #469
---
 src/basicio.cpp | 17 ++++++++++++-----
 src/basicio.hpp |  1 +
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/basicio.cpp b/src/basicio.cpp
index fc8fb78..4983e3c 100644
--- a/src/basicio.cpp
+++ b/src/basicio.cpp
@@ -337,7 +337,8 @@ namespace Exiv2 {
           idx_(0),
           size_(0),
           sizeAlloced_(0),
-          isMalloced_(false)
+          isMalloced_(false),
+          eof_(false)
     {
     }
 
@@ -346,7 +347,8 @@ namespace Exiv2 {
           idx_(0),
           size_(size),
           sizeAlloced_(0),
-          isMalloced_(false)
+          isMalloced_(false),
+          eof_(false)
     {
     }
 
@@ -462,6 +464,7 @@ namespace Exiv2 {
 
         if (newIdx < 0 || newIdx > size_) return 1;
         idx_ = newIdx;
+        eof_ = false;
         return 0;
     }
 
@@ -478,6 +481,7 @@ namespace Exiv2 {
     int MemIo::open()
     {
         idx_ = 0;
+        eof_ = false;
         return 0;
     }
 
@@ -503,15 +507,18 @@ namespace Exiv2 {
     {
         long avail = size_ - idx_;
         long allow = std::min(rcount, avail);
-
         memcpy(buf, &data_[idx_], allow);
         idx_ += allow;
+        if (rcount > avail) eof_ = true;
         return allow;
     }
 
     int MemIo::getb()
     {
-        if (idx_ == size_) return EOF;
+        if (idx_ == size_) {
+            eof_ = true;
+            return EOF;
+        }
         return data_[idx_++];
     }
 
@@ -522,7 +529,7 @@ namespace Exiv2 {
 
     bool MemIo::eof() const
     {
-        return idx_ == size_;
+        return eof_;
     }
 
     std::string MemIo::path() const
diff --git a/src/basicio.hpp b/src/basicio.hpp
index 4f5b5b1..1726569 100644
--- a/src/basicio.hpp
+++ b/src/basicio.hpp
@@ -633,6 +633,7 @@ namespace Exiv2 {
         long size_;
         long sizeAlloced_;              //!< Size of the allocated buffer
         bool isMalloced_;               //!< Was the buffer allocated?
+        bool eof_;
 
         // METHODS
         void reserve(long wcount);

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list