From a45068cf2760c886ce439ba26d0769b635fb3e57 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 31 Aug 2011 16:38:09 -0700 Subject: [PATCH] Convert fs::path_is_absolute internals to istrs. Issue #855 --- src/lib/fs.rs | 2 +- src/lib/posix_fs.rs | 2 +- src/lib/win32_fs.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/fs.rs b/src/lib/fs.rs index 6005467438e..0e9dc591756 100644 --- a/src/lib/fs.rs +++ b/src/lib/fs.rs @@ -61,7 +61,7 @@ fn list_dir(p: &path) -> [istr] { } fn path_is_absolute(p: &path) -> bool { - ret os_fs::path_is_absolute(istr::to_estr(p)); + ret os_fs::path_is_absolute(p); } // FIXME: under Windows, we should prepend the current drive letter to paths diff --git a/src/lib/posix_fs.rs b/src/lib/posix_fs.rs index 43ade4a7703..1c82b64a3e0 100644 --- a/src/lib/posix_fs.rs +++ b/src/lib/posix_fs.rs @@ -32,7 +32,7 @@ fn list_dir(path: str) -> [str] { } -fn path_is_absolute(p: str) -> bool { ret str::char_at(p, 0u) == '/'; } +fn path_is_absolute(p: &istr) -> bool { ret istr::char_at(p, 0u) == '/'; } const path_sep: char = '/'; diff --git a/src/lib/win32_fs.rs b/src/lib/win32_fs.rs index 5890e1f4443..679a440da05 100644 --- a/src/lib/win32_fs.rs +++ b/src/lib/win32_fs.rs @@ -7,9 +7,9 @@ native "rust" mod rustrt { fn list_dir(path: str) -> [str] { ret *rustrt::rust_list_files(path + "*"); } -fn path_is_absolute(p: str) -> bool { - ret str::char_at(p, 0u) == '/' || - str::char_at(p, 1u) == ':' && str::char_at(p, 2u) == '\\'; +fn path_is_absolute(p: &istr) -> bool { + ret istr::char_at(p, 0u) == '/' || + istr::char_at(p, 1u) == ':' && istr::char_at(p, 2u) == '\\'; } /* FIXME: win32 path handling actually accepts '/' or '\' and has subtly