path -> PathBuf for openbsd/bitrig

This commit is contained in:
Sébastien Marie 2015-02-26 06:16:41 +01:00
parent 610d1695d1
commit 653ceee3b3

View File

@ -229,7 +229,8 @@ pub fn current_exe() -> io::Result<PathBuf> {
if v.is_null() {
Err(io::Error::last_os_error())
} else {
Ok(Path::new(CStr::from_ptr(v).to_bytes().to_vec()))
let vec = CStr::from_ptr(v).to_bytes().to_vec();
Ok(PathBuf::new::<OsString>(&OsStringExt::from_vec(vec)))
}
}
}