From f03af22ccdab7d7e0b4e52b7d9cc8daaa12f2ce4 Mon Sep 17 00:00:00 2001 From: Andreas Huggel Date: Wed, 17 Feb 2010 13:42:15 +0000 Subject: [PATCH] #683: Fixed -r conversions for weekday and day of year. --- src/actions.cpp | 4 ++++ test/bugfixes-test.sh | 6 ++++++ test/data/bugfixes-test.out | Bin 69923 -> 70017 bytes 3 files changed, 10 insertions(+) diff --git a/src/actions.cpp b/src/actions.cpp index 72a0b787..8a95c212 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -1848,6 +1848,10 @@ namespace { if (!Util::strtol(timeStr.substr(17,2).c_str(), tmp)) return 10; tm->tm_sec = tmp; + // Conversions to set remaining fields of the tm structure + time_t time = timegm(tm); + if (time == (time_t)-1 || gmtime_r(&time, tm) == 0) return 11; + return 0; } // str2Tm diff --git a/test/bugfixes-test.sh b/test/bugfixes-test.sh index 4d765586..aadd3ac2 100755 --- a/test/bugfixes-test.sh +++ b/test/bugfixes-test.sh @@ -142,6 +142,12 @@ $exiv2 -v -M'set Exif.Image.Make NIKON' \ $exiv2 -pa -u -b $filename +num=683 +filename=exiv2-bug$num.jpg +cp -f ../data/exiv2-nikon-d70.jpg $filename +echo '------>' Bug $num '<-------' >&2 +$exiv2 -v -f -r %Y-%m-%d-%a-%j $filename + ) > $results 2>&1 # ---------------------------------------------------------------------- diff --git a/test/data/bugfixes-test.out b/test/data/bugfixes-test.out index bd0d37bce75b5a94e548f36ff6c3351bf3f8a5c1..2dc0a54166e17ced90b195389b89f659d4edf785 100644 GIT binary patch delta 82 zcmZ3yh^28cOT!jMWkG&jFtAf_Dos}~voM}KS5DRlNb6-4q;mzO<|XE4=A|p7W#*(R el;kVu=^GgsnCKc9>lz#AhLoo28dw^DRRRFcw-((1 delta 11 ScmZo%%(8e9OT!jMWkCQNU<2C#