Fix loading of file URLs with spaces

This commit is contained in:
Jack Moffitt 2014-09-10 18:13:25 -06:00
parent 6bf8412f9a
commit 5f713517a2

View file

@ -35,7 +35,8 @@ pub fn factory() -> LoaderTask {
assert!("file" == url.scheme.as_slice());
let progress_chan = start_sending(start_chan, Metadata::default(url.clone()));
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) => {
let res = read_all(reader as &mut io::Stream, &progress_chan);
progress_chan.send(Done(res));