Draft
Conversation
f20b3d9 to
ef28701
Compare
Collaborator
Author
|
This is somewhat an experimental implementation. When opening a file in the UI, change "filter" to "All files" and then select a zip/tar/tgz/tar.gz formatted file. |
footballhead
reviewed
Jan 7, 2026
- Add a dive aware archive extractor. - Extract content to temp file if we opened an archive. - Update path lookup logic.
footballhead
reviewed
Jan 7, 2026
| archive_read_free(archive_reader); | ||
| } | ||
|
|
||
| using UniqueArchiveReadPtr = std::unique_ptr<struct archive, decltype(&ArchiveReadCloseAndFree)>; |
Collaborator
There was a problem hiding this comment.
👍 Good use of unique_ptr to create an RAII type
| while (true) | ||
| { | ||
| struct archive_entry* entry = nullptr; | ||
| if (auto res = archive_read_next_header(reader.get(), &entry); res != ARCHIVE_OK) |
Collaborator
There was a problem hiding this comment.
nit: since res isn't used outside the if, can be omitted
Suggested change
| if (auto res = archive_read_next_header(reader.get(), &entry); res != ARCHIVE_OK) | |
| if (archive_read_next_header(reader.get(), &entry) != ARCHIVE_OK) |
|
|
||
| auto dst_file_path = dst / entry_path.filename(); | ||
| std::ofstream dst_file(dst_file_path, std::ios::binary | std::ios::out); | ||
| if (auto res = WriteArchiveEntry(dst_file, reader.get()); res != ARCHIVE_OK) |
Collaborator
There was a problem hiding this comment.
nit: since res isn't used outside the if, can be omitted
Suggested change
| if (auto res = WriteArchiveEntry(dst_file, reader.get()); res != ARCHIVE_OK) | |
| if (WriteArchiveEntry(dst_file, reader.get()) != ARCHIVE_OK) |
Comment on lines
+128
to
+129
| if (auto res = archive_read_open_filename(reader.get(), m_path.string().c_str(), kBlockSize); | ||
| res != ARCHIVE_OK) |
Collaborator
There was a problem hiding this comment.
nit: since res isn't used outside the if, can be omitted
Suggested change
| if (auto res = archive_read_open_filename(reader.get(), m_path.string().c_str(), kBlockSize); | |
| res != ARCHIVE_OK) | |
| if (archive_read_open_filename(reader.get(), m_path.string().c_str(), kBlockSize) != ARCHIVE_OK) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.