Skip to content

Commit 18af00e

Browse files
committed
---
yaml --- r: 5112 b: refs/heads/master c: 8f531e7 h: refs/heads/master v: v3
1 parent 9c1f35f commit 18af00e

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: baa1e8790d6c8d04de5a371a1c231ca9f2caa3b0
2+
refs/heads/master: 8f531e769a025859eeebf6e99c50c4b786fb0814

trunk/src/lib/fs.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import os_fs;
44
import str;
55

66
native "rust" mod rustrt {
7-
fn rust_file_is_dir(path: str) -> int;
7+
fn rust_file_is_dir(path: istr::sbuf) -> int;
88
}
99

1010
fn path_sep() -> istr { ret istr::from_char(os_fs::path_sep); }
@@ -43,7 +43,9 @@ fn connect(pre: &path, post: &path) -> path {
4343
}
4444

4545
fn file_is_dir(p: &path) -> bool {
46-
ret rustrt::rust_file_is_dir(istr::to_estr(p)) != 0;
46+
ret istr::as_buf(p, { |buf|
47+
rustrt::rust_file_is_dir(buf) != 0
48+
});
4749
}
4850

4951
fn list_dir(p: &path) -> [istr] {

trunk/src/rt/rust_builtin.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,9 @@ rust_dirent_filename(rust_task *task, dirent* ent) {
444444
#endif
445445

446446
extern "C" CDECL int
447-
rust_file_is_dir(rust_task *task, rust_str *path) {
447+
rust_file_is_dir(rust_task *task, char *path) {
448448
struct stat buf;
449-
if (stat((char*)path->data, &buf)) {
449+
if (stat(path, &buf)) {
450450
return 0;
451451
}
452452
return S_ISDIR(buf.st_mode);

0 commit comments

Comments
 (0)