mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Merge pull request #3280 from metajack/path-with-spaces
Fix loading of file URLs with spaces
This commit is contained in:
commit
3bd5ef3384
1 changed files with 2 additions and 1 deletions
|
@ -35,7 +35,8 @@ pub fn factory() -> LoaderTask {
|
||||||
assert!("file" == url.scheme.as_slice());
|
assert!("file" == url.scheme.as_slice());
|
||||||
let progress_chan = start_sending(start_chan, Metadata::default(url.clone()));
|
let progress_chan = start_sending(start_chan, Metadata::default(url.clone()));
|
||||||
spawn_named("file_loader", proc() {
|
spawn_named("file_loader", proc() {
|
||||||
match File::open_mode(&Path::new(url.serialize_path().unwrap()), io::Open, io::Read) {
|
let file_path: Path = url.to_file_path().unwrap();
|
||||||
|
match File::open_mode(&Path::new(file_path), io::Open, io::Read) {
|
||||||
Ok(ref mut reader) => {
|
Ok(ref mut reader) => {
|
||||||
let res = read_all(reader as &mut io::Stream, &progress_chan);
|
let res = read_all(reader as &mut io::Stream, &progress_chan);
|
||||||
progress_chan.send(Done(res));
|
progress_chan.send(Done(res));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue