From 7d81db6e29483c0d4dc56169f3983c538830f51f Mon Sep 17 00:00:00 2001 From: Josh Aas Date: Thu, 11 Apr 2013 21:38:17 -0500 Subject: [PATCH] Fix 'make_url' to handle absolute paths properly, allows servo command line to handle absolute paths. --- src/servo-gfx/util/url.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()