Skip to content

Commit d79330d

Browse files
committed
Fix logic bug in std::fs::dirname.
1 parent 83b7215 commit d79330d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn dirname(path p) -> path {
1515
let int i = str::rindex(p, os_fs::path_sep as u8);
1616
if (i == -1) {
1717
i = str::rindex(p, os_fs::alt_path_sep as u8);
18-
if (i == -1) { ret p; }
18+
if (i == -1) { ret "."; }
1919
}
2020
ret str::substr(p, 0u, i as uint);
2121
}

0 commit comments

Comments
 (0)