Skip to content

Commit a1d8c88

Browse files
author
bors-servo
authored
Auto merge of #477 - redox-os:redox, r=SimonSapin
Redox support Redox uses `file:` at the beginning of any file paths. Therefore, a path like `file:///home/user/some%20file.txt` needs to turn into `file:/home/user/some file.txt` <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/477) <!-- Reviewable:end -->
2 parents 3851a94 + 01404b7 commit a1d8c88

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2351,7 +2351,11 @@ fn file_url_segments_to_pathbuf(host: Option<&str>, segments: str::Split<char>)
23512351
return Err(());
23522352
}
23532353

2354-
let mut bytes = Vec::new();
2354+
let mut bytes = if cfg!(target_os = "redox") {
2355+
b"file:".to_vec()
2356+
} else {
2357+
Vec::new()
2358+
};
23552359
for segment in segments {
23562360
bytes.push(b'/');
23572361
bytes.extend(percent_decode(segment.as_bytes()));

0 commit comments

Comments
 (0)