Skip to content

Commit e57f670

Browse files
committed
---
yaml --- r: 2387 b: refs/heads/master c: 50ac893 h: refs/heads/master i: 2385: 31c62ca 2383: 2a470f2 v: v3
1 parent 08cd368 commit e57f670

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 9a1f0977a227a14fa521f8e0efe5edcbf81eb597
2+
refs/heads/master: 50ac893b00853fa832a0f689b81104bd82e2a9b5

trunk/src/lib/fs.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@ fn path_sep() -> str {
99
type path = str;
1010

1111
fn dirname(path p) -> path {
12-
auto sep = path_sep();
13-
assert (_str.byte_len(sep) == 1u);
14-
let int i = _str.rindex(p, sep.(0));
12+
let int i = _str.rindex(p, os_fs.path_sep as u8);
1513
if (i == -1) {
16-
// FIXME: the '/' character is a path separator on all 3 platforms we
17-
// support. This should probably be generalized a bit more in the
18-
// future, but for now this should work.
19-
i = _str.rindex(p, '/' as u8);
14+
i = _str.rindex(p, os_fs.alt_path_sep as u8);
2015
if (i == -1) {
2116
ret p;
2217
}

trunk/src/lib/posix_fs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ fn list_dir(str path) -> vec[str] {
2020
}
2121

2222
const char path_sep = '/';
23+
const char alt_path_sep = '/';
2324

2425
// Local Variables:
2526
// mode: rust;

trunk/src/lib/win32_fs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ fn list_dir(str path) -> vec[str] {
1414
* tag type.
1515
*/
1616
const char path_sep = '/';
17+
const char alt_path_sep = '\\';
1718

1819
// Local Variables:
1920
// mode: rust;

0 commit comments

Comments
 (0)