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

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


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

The following commit has been merged in the master branch:
commit 617779ec557a4266552980cfedc0cf3a7d04a62c
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Mon May 2 14:46:59 2011 +0000

    Fixed time setting of -T option when DST is in effect.
---
 src/actions.cpp | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/actions.cpp b/src/actions.cpp
index 3018395..f8699e5 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -104,11 +104,11 @@ namespace {
      */
     int str2Tm(const std::string& timeStr, struct tm* tm);
 
-    //! Convert a UTC time to a string "YYYY:MM:DD HH:MI:SS", "" on error
+    //! Convert a localtime to a string "YYYY:MM:DD HH:MI:SS", "" on error
     std::string time2Str(time_t time);
 
     //! Convert a tm structure to a string "YYYY:MM:DD HH:MI:SS", "" on error
-    std::string tm2Str(struct tm* tm);
+    std::string tm2Str(const struct tm* tm);
 
     /*!
       @brief Copy metadata from source to target according to Params::copyXyz
@@ -1565,7 +1565,7 @@ namespace Action {
                       << " " << _("years") << "
";
             return 1;
         }
-        time_t time = timegm(&tm);
+        time_t time = mktime(&tm);
         time += adjustment_ + dayAdjustment_ * 86400;
         timeStr = time2Str(time);
         if (Params::instance().verbose_) {
@@ -1739,7 +1739,7 @@ namespace {
     int Timestamp::read(struct tm* tm)
     {
         int rc = 1;
-        time_t t = mktime(tm);
+        time_t t = mktime(tm); // interpret tm according to current timezone settings
         if (t != (time_t)-1) {
             rc = 0;
             actime_  = t;
@@ -1783,22 +1783,18 @@ namespace {
         tm->tm_sec = tmp;
 
         // Conversions to set remaining fields of the tm structure
-        time_t time = timegm(tm);
-#ifdef EXV_HAVE_GMTIME_R
-        if (time == (time_t)-1 || gmtime_r(&time, tm) == 0) return 11;
-#else
-        if (time == (time_t)-1 || std::gmtime(&time)  == 0) return 11;
-#endif
+        if (mktime(tm) == (time_t)-1) return 11;
+
         return 0;
     } // str2Tm
 
     std::string time2Str(time_t time)
     {
-        struct tm* tm = gmtime(&time);
+        struct tm* tm = localtime(&time);
         return tm2Str(tm);
     } // time2Str
 
-    std::string tm2Str(struct tm* tm)
+    std::string tm2Str(const struct tm* tm)
     {
         if (0 == tm) return "";
 

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list