diff options
| author | Graydon Hoare <[email protected]> | 2011-05-05 14:31:10 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-05-05 14:31:45 -0700 |
| commit | 50ac893b00853fa832a0f689b81104bd82e2a9b5 (patch) | |
| tree | e1b2220a5fd356c41330d17234c2ca302d8f18c9 /src/lib/fs.rs | |
| parent | rustc: Fix bug in equal_abi that was preventing Rust intrinsics from working (diff) | |
| download | rust-50ac893b00853fa832a0f689b81104bd82e2a9b5.tar.xz rust-50ac893b00853fa832a0f689b81104bd82e2a9b5.zip | |
Attempt to fix fs.dirname harder.
Diffstat (limited to 'src/lib/fs.rs')
| -rw-r--r-- | src/lib/fs.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/lib/fs.rs b/src/lib/fs.rs index 29719233..0a951e5a 100644 --- a/src/lib/fs.rs +++ b/src/lib/fs.rs @@ -9,14 +9,9 @@ fn path_sep() -> str { type path = str; fn dirname(path p) -> path { - auto sep = path_sep(); - assert (_str.byte_len(sep) == 1u); - let int i = _str.rindex(p, sep.(0)); + let int i = _str.rindex(p, os_fs.path_sep as u8); if (i == -1) { - // FIXME: the '/' character is a path separator on all 3 platforms we - // support. This should probably be generalized a bit more in the - // future, but for now this should work. - i = _str.rindex(p, '/' as u8); + i = _str.rindex(p, os_fs.alt_path_sep as u8); if (i == -1) { ret p; } |