LocalPath: prefix matching needs a four-way path kind, not IsPathRooted
@ForNeVeR is already working on this.
Since Sep 21, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp
- Domain
- operating-systems
Research direction
Start by reading LocalPath.IsPrefixOf, LocalPath.IsAbsolute, and both TODOs, then trace how PathStrings.Normalize represents drive-relative paths such as C:. Done means LocalPath distinguishes true absolute, rooted diskless, drive-relative, and true relative paths, and IsPrefixOf never treats different kinds as prefixes.
Written by the indexing model from the issue text.
Description
LocalPath.IsPrefixOf uses IsAbsolute (i.e. Path.IsPathRooted) to refuse comparisons between paths of differing absoluteness. That is only an approximation, because on Windows there are really four kinds of path, and no path of one kind should ever be considered a prefix of a path of another:
- true absolute —
C:\Windows - rooted diskless —
\Windows - current on disk —
C:(andC:Windows, relative to the current directory of driveC:) - true relative —
Windows,..\Windows
AbsolutePath exists to cover kind 1 only, while LocalPath is applicable to all four. IsPathRooted answers true for kinds 1, 2 and 3 alike, so the current check only separates {1, 2, 3} from {4}.
Kind 3 is genuinely representable: PathStrings.Normalize returns "C:" for input "C:", so new LocalPath("C:") is a real value. It is currently reported as a prefix of C:\Windows, which is wrong.
LocalPath.IsAbsolute is already documented as subject to narrowing to kind 1. When that happens, IsPrefixOf must not simply follow it — it needs the full four-way distinction, so the path kind should be extracted into a separate field or property and matched on there. Both carry a TODO pointing here, and both must be resolved in one change.
Related to #23 (the WIP RelativePath type), but distinct: this is about LocalPath carrying a path kind internally.
- 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 help wanted
Difficulty 3/5 1-2 days Newbie friendliness 68/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
-
effort:S P3 refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
nightscout/nocturne#1532 ·
-
core dependencies
Difficulty 1/5 Under an hour Newbie friendliness 80/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
C#/.NET Roslyn LSP Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
DotNetNext/SqlSugar#1458 ·