We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5f2f76 commit c80255eCopy full SHA for c80255e
src/lib/fs.rs
@@ -13,7 +13,13 @@ fn dirname(path p) -> path {
13
assert (_str.byte_len(sep) == 1u);
14
let int i = _str.rindex(p, sep.(0));
15
if (i == -1) {
16
- ret p;
+ // 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, '/');
20
+ if (i == -1) {
21
+ ret p;
22
+ }
23
}
24
ret _str.substr(p, 0u, i as uint);
25
0 commit comments