Distinguish Windows drive-relative, rooted and UNC paths in path_is_abs
- Dominant language
- Rust
- Stars
- 53
- Forks
- 16
- Avg merge
- 4h 22m
- Merged PRs (30d)
- 46
Description
`path_is_abs` returns true for any nonempty character followed by a colon, and recognizes a leading slash but not a leading backslash. This classifies `C:relative` and `1:relative` as absolute while rejecting a full UNC path such as `\\server\share\file`. Windows drive-relative names must not be confused with a drive root. The function also needs an explicit target policy instead of applying drive syntax indiscriminately to Unix paths.
Source evidence at the head of #520:
- [std/path/core.wave:41](https://github.com/wavefnd/Wave/blob/2ae0a91c57fd76323124c0e4dff552adbfadbe1b/std/path/core.wave#L41) — `pub fun path_is_abs`
Acceptance:
- [ ] Make the target-specific interpretation explicit in the implementation and short API comments.
- [ ] Cover relative names, drive-relative C:foo, drive-rooted C:\foo, UNC paths, root-relative paths and ordinary Unix absolute paths.
- [ ] Require a valid drive prefix and distinguish rooted paths from fully qualified paths where needed.
- [ ] Keep byte-boundary reads safe for empty and one-byte strings.
API/reference context: [Windows fully qualified and relative paths](https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file).
Audit status: identified by static source inspection; the scenarios above have not been executed during this audit. The permalink fixes the reviewed revision; this report does not claim the defect was introduced by #520.
Contributor guide
Research direction
Start at std/path/core.wave:41 and read the path_is_abs implementation and its surrounding API comments. Exercise the listed relative, drive-relative, drive-rooted, UNC, root-relative, Unix, empty, and one-byte cases; done means target policy, valid drive prefixes, rooted-versus-fully-qualified paths, and safe byte-boundary reads are covered.
Written by the indexing model from the issue text.
Assessment
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100