IsPrefixOf compares segment strings, not directory depth, for paths with leading ".."
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp
- Domain
- operating-systems
Research direction
Start at the IsPrefixOf entry point and inspect how normalized path segments are compared, then review the related empty-path behavior from #223. Model leading .. depth for relative paths and verify the examples in the issue, including the /.. case for AbsolutePath.
Written by the indexing model from the issue text.
Description
IsPrefixOf decides containment by comparing normalized path strings segment by segment. That is correct as long as neither path begins with a .. reference — but .. moves up, so a string prefix stops implying containment:
new LocalPath("..").IsPrefixOf(new LocalPath("foo")); // false, though foo is CWD/foo, which is under ..
new LocalPath("..").IsPrefixOf(new LocalPath("../..")); // true, though ../.. is above .., not under it
Answering these correctly means modelling how far above the current directory a path starts — the number of leading .. references — and comparing that together with the remaining segments, rather than comparing strings.
This affects AbsolutePath too: /.. survives normalization, so new AbsolutePath("/..") is a constructible value.
Both behaviors predate #223. A closely related case was fixed there: the empty path (the current directory) was reported as a prefix of ../evil.
- Dominant language
- C#
- Stars
- 104
- Forks
- 19
- Avg merge
- 13h 42m
- Merged PRs (30d)
- 9
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ForNeVeR/TruePath
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Dependency Dashboard Opendashboard
Difficulty 3/5 1-2 days Newbie friendliness 15/100
-
enhancement good first issue help wanted
Difficulty 4/5 3-5 days Newbie friendliness 38/100
All issues in ForNeVeR/TruePath
Similar issues
-
Documentation
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
cake-build/cake#5024 ·
-
Frontend status/draft TechnicalDebt
Difficulty 2/5 1-2 days Newbie friendliness 75/100
Altinn/altinn-auth#4143 ·
-
.NET Flaky Test Testing Tests
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
getsentry/sentry-dotnet#5617 · 1 comment ·
-
:watch: Not Triaged dotnet-fsharp/svc
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Azure/azure-sdk-for-net#63292 · 3 comments · 1 reaction ·