Replacing str::unsafe_from_bytes with str::from_bytes (part 1)

This commit is contained in:
Kevin Cantu
2012-01-25 00:53:17 -08:00
parent 9750e83a17
commit c7b23f9a86
10 changed files with 16 additions and 11 deletions

View File

@@ -125,7 +125,8 @@ fn dylib_filename(base: str) -> str { ret "lib" + base + ".so"; }
/// followed by a path separator
fn get_exe_path() -> option::t<fs::path> {
let bufsize = 1023u;
let path = str::unsafe_from_bytes(vec::init_elt(bufsize, 0u8));
// FIXME: path "strings" will likely need fixing...
let path = str::from_bytes(vec::init_elt(bufsize, 0u8));
ret str::as_buf("/proc/self/exe", { |proc_self_buf|
str::as_buf(path, { |path_buf|
if libc::readlink(proc_self_buf, path_buf, bufsize) != -1 {