Skip to content

Fix SIT classic parser miscounting folder markers as files#1

Merged
pappadf merged 1 commit into
mainfrom
fix/sit-folder-count
Apr 9, 2026
Merged

Fix SIT classic parser miscounting folder markers as files#1
pappadf merged 1 commit into
mainfrom
fix/sit-folder-count

Conversation

@pappadf
Copy link
Copy Markdown
Owner

@pappadf pappadf commented Apr 9, 2026

Folder start (0x20) and folder end (0x21) markers were incorrectly incrementing the done counter in parse_classic(), causing the iteration loop to terminate early when archives contained folders.

The SIT spec (sit.md § 4.7) explicitly states: "Folder markers do not contribute to file_count." The file_count field only counts actual file entries, not structural folder markers.

This caused archives like to extract zero files: the folder-start marker consumed the entire file_count budget of 1, and the loop exited before reaching the actual file entry.

Folder start (0x20) and folder end (0x21) markers were incorrectly
incrementing the `done` counter in parse_classic(), causing the
iteration loop to terminate early when archives contained folders.

The SIT spec (sit.md § 4.7) explicitly states: "Folder markers do
not contribute to file_count." The file_count field only counts
actual file entries, not structural folder markers.

This caused archives like SSW_7.0-800k.sit.Hqx (which wraps a
single file inside a folder) to extract zero files: the folder-start
marker consumed the entire file_count budget of 1, and the loop
exited before reaching the actual file entry.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pappadf pappadf merged commit 084d0c4 into main Apr 9, 2026
1 check passed
@pappadf pappadf deleted the fix/sit-folder-count branch April 9, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant