Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
if !pathNfilename_abs.is_null() {
let path = std::path::Path::new(
std::ffi::CStr::from_ptr(pathNfilename_abs)
.to_str()
.unwrap(),
);
match fs::canonicalize(path) {
Ok(v) => {
return to_cstring(v.to_str().unwrap());
}
Err(e) => return 0 as *mut libc::c_char,
}
} else {
pathNfilename_abs
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.