1
Fork 0

rustpkg: Implement RUST_PATH

Unfortunately, the main test for this is ignored due to #7071.

Closes #5682
This commit is contained in:
Tim Chevalier 2013-06-25 19:49:01 -07:00
parent 9b6dfb8578
commit ea62fd1090
3 changed files with 94 additions and 11 deletions

View file

@ -382,6 +382,15 @@ impl Path {
Some(ref st) => Some(st.st_mode as uint),
}
}
/// Execute a function on p as well as all of its ancestors
pub fn each_parent(&self, f: &fn(&Path)) {
if !self.components.is_empty() {
f(self);
self.pop().each_parent(f);
}
}
}
#[cfg(target_os = "freebsd")]