Merge pull request #3280 from metajack/path-with-spaces

Fix loading of file URLs with spaces
This commit is contained in:
glennw 2014-09-11 13:50:03 +10:00
commit 3bd5ef3384

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));