Repository navigation
fix: extended timestamp in central header refers to the local header - #1310
Conversation
There was a problem hiding this comment.
Review Summary
This PR correctly fixes the extended timestamp handling in the central directory header to conform with the ZIP specification. Per the spec, the flags byte in the central directory's extended timestamp field describes what the local header contains — it is not a description of the central header's own data. The old code incorrectly masked off the Accessed and Created flag bits when writing a central header, so a reader following the spec would incorrectly infer that the local header had no access or creation timestamps.
The corresponding test assertion update (changing 0b0000_0001 → 0b0000_0111) is consistent with this fix.
One minor issue (not blocking): The comment // in the central header at line 408 of test_extended_timestamp is a pre-existing mislabeling — the call on line 410 passes is_local_header: true, so it is actually testing the local header path. Since a new, properly-named test_extended_timestamp_in_central_header test was added in this PR, the misleading comment in the existing test becomes more visible and should be corrected to avoid confusion for future contributors. This is not a logic error and does not block the merge.
The logic change itself is correct and no blocking defects were found.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
|
wait I need to correct the comment. From amazon review |
|
Thanks for catching this and opening the fix, @Its-Just-Nans! The change matches Two tiny cleanup notes while you're touching
LGTM! |
|
I will make a new PR for the comments Thanks for the review |
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.