Created
June 7, 2019 22:35
-
-
Save ralphtheninja/718bdb4d12856075d8f05e0ddee210c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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