Fix double slash when rejoining USTAR prefix and name - #131793
Draft
alinpahontu2912 with Copilot wants to merge 2 commits into
Draft
Fix double slash when rejoining USTAR prefix and name#131793alinpahontu2912 with Copilot wants to merge 2 commits into
alinpahontu2912 with Copilot wants to merge 2 commits into
Conversation
Co-authored-by: alinpahontu2912 <56953855+alinpahontu2912@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
alinpahontu2912
August 4, 2026 10:20
View session
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes USTAR header name reconstruction so archives that (incorrectly) include a trailing / in the prefix field don’t produce a synthesized // when combining prefix + name.
Changes:
- Update
ReadUstarAttributesto conditionally insert the/separator only when_prefixdoesn’t already end with/.
Comment on lines
+568
to
+572
| // Prefix should not have a trailing separator, but to avoid producing a | ||
| // synthesized double slash for archives that do include one, only add | ||
| // the separator when it is not already present. | ||
| // It should always be a forward slash for compatibility. | ||
| _name = _prefix.EndsWith('/') ? $"{_prefix}{_name}" : $"{_prefix}/{_name}"; |
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-formats-tar |
Co-authored-by: alinpahontu2912 <56953855+alinpahontu2912@users.noreply.github.com>
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.
ReadUstarAttributesunconditionally joined a non-empty ustarprefixandnamewith/, assuming the prefix never already ends with a separator. Archives with a trailing-slash prefix produced a synthesized//in the resulting logical path.Changes
TarHeader.Read.cs: check whether_prefixalready ends with/before inserting the separator when rejoiningprefixandname.