diff --git a/src/servo-gfx/util/url.rs b/src/servo-gfx/util/url.rs index 99ff6178458..e12ad9761cf 100644 --- a/src/servo-gfx/util/url.rs +++ b/src/servo-gfx/util/url.rs @@ -22,7 +22,7 @@ pub fn make_url(str_url: ~str, current_url: Option) -> Url { if current_url.is_none() { // Assume we've been given a file path. If it's absolute just return // it, otherwise make it absolute with the cwd. - if str_url[0] == "/"[0] { + if str_url.starts_with("/") { ~"file://" + str_url } else { ~"file://" + os::getcwd().push(str_url).to_str()