[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:43 UTC 2017


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

The following commit has been merged in the master branch:
commit 5099f2463f79266e9d32c253c93619516aa032f6
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sat Jun 10 15:13:19 2006 +0000

    Fixed MSVC 2005 assertion triggered by iotest
---
 src/basicio.cpp | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/basicio.cpp b/src/basicio.cpp
index 4983e3c..b18d483 100644
--- a/src/basicio.cpp
+++ b/src/basicio.cpp
@@ -105,21 +105,15 @@ namespace Exiv2 {
         opMode_ = opMode;
 
         bool reopen = true;
-        std::string mode = "r+b";
-
         switch(opMode) {
         case opRead:
             // Flush if current mode allows reading, else reopen (in mode "r+b"
             // as in this case we know that we can write to the file)
-            if (   openMode_[0] == 'r'
-                || openMode_.substr(0, 2) == "w+"
-                || openMode_.substr(0, 2) == "a+") reopen = false;
+            if (openMode_[0] == 'r' || openMode_[1] == '+') reopen = false;
             break;
         case opWrite:
             // Flush if current mode allows writing, else reopen
-            if (   openMode_.substr(0, 2) == "r+"
-                || openMode_[0] == 'w'
-                || openMode_[0] == 'a') reopen = false;
+            if (openMode_[0] != 'r' || openMode_[1] == '+') reopen = false;
             break;
         case opSeek:
             reopen = false;
@@ -139,7 +133,7 @@ namespace Exiv2 {
         // Reopen the file
         long offset = ftell(fp_);
         if (offset == -1) return -1;
-        if (open(mode) != 0) return 1;
+        if (open("r+b") != 0) return 1;
         return fseek(fp_, offset, SEEK_SET);
     }
 
@@ -245,7 +239,8 @@ namespace Exiv2 {
 
     long FileIo::size() const
     {
-        if (fp_ != 0) {
+        // Flush and commit only if the file is open for writing
+        if (fp_ != 0 && (openMode_[0] != 'r' || openMode_[1] == '+')) {
             fflush(fp_);
 #if defined WIN32 && !defined __CYGWIN__
             // This is required on msvcrt before stat after writing to a file

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list