fix build · rust-lang/rust@fc50aca

File tree

1 file changed

lines changed

  • library/std/src/sys/pal/unix

1 file changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -748,8 +748,7 @@ pub fn home_dir() -> Option<PathBuf> {

748748

&mut result,

749749

) {

750750

0 if !result.is_null() => {

751-

let passwd = p.assume_init();

752-

let ptr = passwd.pw_dir as *const _;

751+

let ptr = (*result).pw_dir as *const _;

753752

let bytes = CStr::from_ptr(ptr).to_bytes().to_vec();

754753

Some(OsStringExt::from_vec(bytes))

755754

}