Skip to content

Conversation

@Lamparter
Copy link
Contributor

Resolved / Related Issues

Steps used to test these changes

  1. Opened Files
  2. Create an archive in a directory using tar --exclude=archive.tar -cf archive.tar . in Powershell
  3. Do the 'Extract (smart)' action on the newly created tar archive
  4. See that the folder '.' in the archive gets renamed to the archive name 'archive'

Copilot AI review requested due to automatic review settings January 17, 2026 12:12
@Lamparter Lamparter changed the title Fix "." and ".." in archives being extracted wrong Fix: Fixed an issue where archives with reserved item names wouldn't extract correctly Jan 17, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where "." and ".." directory entries in archives were being incorrectly treated as meaningful top-level items during smart extraction. The fix ensures that when using "Extract (smart)" on archives containing "." (current directory) or ".." (parent directory) entries, these special directory references are properly ignored when determining whether to create a subfolder.

Changes:

  • Refactored the logic for detecting multiple top-level items in archives to filter out "." and ".." entries
  • Introduced a new helper function GetFirstMeaningfulSegment that skips special directory references when parsing archive entry paths

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Lamparter Lamparter force-pushed the protected-names-extraction branch from a182e47 to b10666d Compare January 24, 2026 09:03
(just a general readability refactor, no impact made)
@Lamparter
Copy link
Contributor Author

@yaira2 requesting your review

@yaira2
Copy link
Member

yaira2 commented Jan 25, 2026

Noted. I'd like to complete your earlier PRs before reviewing this one.

@yaira2 yaira2 added the ready for review Pull requests that are ready for review label Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Pull requests that are ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Smart extracting a .tar file with "." as the only directory in root is not properly handled

2 participants