Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: third_party/zlib/google/zip_reader.cc

Issue 99333019: Preserve modification timestamp when zipping files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed review issues Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/zlib/google/zip_reader.cc
diff --git a/third_party/zlib/google/zip_reader.cc b/third_party/zlib/google/zip_reader.cc
index 6ea8025094151de4bb83a7947057b0b6dc616387..16f744d45a1385c5deb41fa1524cc7aab670337f 100644
--- a/third_party/zlib/google/zip_reader.cc
+++ b/third_party/zlib/google/zip_reader.cc
@@ -231,7 +231,14 @@ bool ZipReader::ExtractCurrentEntryToFilePath(
}
}
+ stream.CloseSync();
unzCloseCurrentFile(zip_file_);
+
+ if (current_entry_info()->last_modified() != base::Time::UnixEpoch())
+ base::TouchFile(output_file_path,
+ base::Time::Now(),
+ current_entry_info()->last_modified());
+
return success;
}

Powered by Google App Engine
This is Rietveld 408576698