diff options
Diffstat (limited to 'src/Common/libzip/zip_stat_index.c')
-rw-r--r-- | src/Common/libzip/zip_stat_index.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Common/libzip/zip_stat_index.c b/src/Common/libzip/zip_stat_index.c index da33c09e..af9f0e5f 100644 --- a/src/Common/libzip/zip_stat_index.c +++ b/src/Common/libzip/zip_stat_index.c @@ -2,3 +2,3 @@ zip_stat_index.c -- get information about file by index - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner @@ -79,3 +79,3 @@ zip_stat_index(zip_t *za, zip_uint64_t index, zip_flags_t flags, zip_stat_t *st) if (entry->changes != NULL && entry->changes->changed & ZIP_DIRENT_LAST_MOD) { - st->mtime = de->last_mod; + st->mtime = zip_dirent_get_last_mod_mtime(de); st->valid |= ZIP_STAT_MTIME; @@ -88,3 +88,3 @@ zip_stat_index(zip_t *za, zip_uint64_t index, zip_flags_t flags, zip_stat_t *st) st->size = de->uncomp_size; - st->mtime = de->last_mod; + st->mtime = zip_dirent_get_last_mod_mtime(de); st->comp_size = de->comp_size; @@ -99,4 +99,8 @@ zip_stat_index(zip_t *za, zip_uint64_t index, zip_flags_t flags, zip_stat_t *st) if ((za->ch_flags & ZIP_AFL_WANT_TORRENTZIP) && (flags & ZIP_FL_UNCHANGED) == 0) { + if (za->torrent_mtime == 0) { + zip_dostime_t dostime = {0xbc00, 0x2198}; + za->torrent_mtime = _zip_d2u_time(&dostime); + } st->comp_method = ZIP_CM_DEFLATE; - st->mtime = _zip_d2u_time(0xbc00, 0x2198); + st->mtime = za->torrent_mtime; st->valid |= ZIP_STAT_MTIME | ZIP_STAT_COMP_METHOD; |