Skip to content

Only pop drive letters at the start of a path - #1149

Open
konstin wants to merge 2 commits into
servo:mainfrom
konstin:konsti/fix-drive-letter-joining
Open

Only pop drive letters at the start of a path#1149
konstin wants to merge 2 commits into
servo:mainfrom
konstin:konsti/fix-drive-letter-joining

Conversation

@konstin

@konstin konstin commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Disclosure: I found this with automated scanning for crashes in uv. It's one line fix (plus comments and tests), so I'm putting it up anyway.

Currently, in file:///a/c: the c: is erroneously considered a windows drive letter that we have to retain, so file:///a/c: remains instead of becoming file:///a/, subsequently failing the debug assertion at

debug_assert!(self.serialization.as_bytes()[segment_start - 1] == b'/');

The additional check ensure that only file:///c: can be a path.

Disclosure: I found this with automated scanning for crashes in uv. It's one line fix (plus comments and tests), so I'm putting it up anyway.

Currently, in `file:///a/c:` the `c:` is erroneously considered a windows drive letter that we have to retain, so `file:///a/c:` remains instead of becoming `file:///a/`, subsequently failing the debug assertion at https://github.com/servo/rust-url/blob/00a6ce58d02f4e0d43c5ca0702c0bedb8b1ebf3a/url/src/parser.rs#L1301. The additional check ensure that only `file:///c:` can be a path.
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@00a6ce5). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1149   +/-   ##
=======================================
  Coverage        ?   86.97%           
=======================================
  Files           ?       26           
  Lines           ?     5273           
  Branches        ?        0           
=======================================
  Hits            ?     4586           
  Misses          ?      687           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant