From e572bb8db32dad31653dd59252c7126e5637facb Mon Sep 17 00:00:00 2001 From: Ignacio Taranto Date: Wed, 20 Dec 2023 17:39:41 -0300 Subject: [PATCH] Fix Zip file modification timestamps The problem was that `time_to_dos` was putting the last modification file date first and the time second. This was causing the date to be interpreted as the time and vice versa when reading the Zip file. See: https://github.com/ZDoom/gzdoom/issues/2306 --- src/common/utility/writezip.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/utility/writezip.cpp b/src/common/utility/writezip.cpp index 5c0b0e65b9..a6f6f9a276 100644 --- a/src/common/utility/writezip.cpp +++ b/src/common/utility/writezip.cpp @@ -61,8 +61,8 @@ static std::pair time_to_dos(struct tm *time) } else { - val.first = (time->tm_year - 80) * 512 + (time->tm_mon + 1) * 32 + time->tm_mday; - val.second= time->tm_hour * 2048 + time->tm_min * 32 + time->tm_sec / 2; + val.first = time->tm_hour * 2048 + time->tm_min * 32 + time->tm_sec / 2; + val.second = (time->tm_year - 80) * 512 + (time->tm_mon + 1) * 32 + time->tm_mday; } return val; }