From: nooriro Date: Thu, 8 Feb 2024 12:37:31 +0000 (+0900) Subject: Fix FILETIME truncation on `archive_write_finish_entry()` on Windows (#2050) X-Git-Tag: v3.7.3~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=010a2af130923cf616b5d5e094c25101479509b1;p=thirdparty%2Flibarchive.git Fix FILETIME truncation on `archive_write_finish_entry()` on Windows (#2050) On Windows, `archive_write_finish_entry()` does not restore time correctly. It truncates the last digit of original FILETIME which is stored in the archive. This commit fixes this behavior. See libarchive#2049 for detailed explanation on this issue. --- diff --git a/libarchive/archive_write_disk_windows.c b/libarchive/archive_write_disk_windows.c index d87deeb99..774151ae2 100644 --- a/libarchive/archive_write_disk_windows.c +++ b/libarchive/archive_write_disk_windows.c @@ -2594,7 +2594,7 @@ set_times(struct archive_write_disk *a, { #define EPOC_TIME ARCHIVE_LITERAL_ULL(116444736000000000) #define WINTIME(sec, nsec) ((Int32x32To64(sec, 10000000) + EPOC_TIME)\ - + (((nsec)/1000)*10)) + + ((nsec)/100)) HANDLE hw = 0; ULARGE_INTEGER wintm;