File tree Expand file tree Collapse file tree 4 files changed +5
-8
lines changed Expand file tree Collapse file tree 4 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 9a1f0977a227a14fa521f8e0efe5edcbf81eb597
2
+ refs/heads/master: 50ac893b00853fa832a0f689b81104bd82e2a9b5
Original file line number Diff line number Diff line change @@ -9,14 +9,9 @@ fn path_sep() -> str {
9
9
type path = str ;
10
10
11
11
fn dirname ( path p) -> path {
12
- auto sep = path_sep ( ) ;
13
- assert ( _str. byte_len ( sep) == 1 u) ;
14
- let int i = _str. rindex ( p, sep. ( 0 ) ) ;
12
+ let int i = _str. rindex ( p, os_fs. path_sep as u8 ) ;
15
13
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 ) ;
20
15
if ( i == -1 ) {
21
16
ret p;
22
17
}
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ fn list_dir(str path) -> vec[str] {
20
20
}
21
21
22
22
const char path_sep = '/' ;
23
+ const char alt_path_sep = '/' ;
23
24
24
25
// Local Variables:
25
26
// mode: rust;
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ fn list_dir(str path) -> vec[str] {
14
14
* tag type.
15
15
*/
16
16
const char path_sep = '/' ;
17
+ const char alt_path_sep = '\\' ;
17
18
18
19
// Local Variables:
19
20
// mode: rust;
You can’t perform that action at this time.
0 commit comments