1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Merge pull request #255 from Arcterus/id-fix

id: fix on Macs
This commit is contained in:
Oly Mi 2014-06-17 06:24:55 +04:00
commit 50d571717b

View file

@ -260,7 +260,7 @@ fn pretty(possible_pw: Option<c_passwd>) {
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
fn pline(possible_pw: Option<c_passwd>) { fn pline(possible_pw: Option<c_passwd>) {
let pw = if possible_pw.is_none() { let pw = if possible_pw.is_none() {
unsafe { read(getpwuid(getuid() as i32)) } unsafe { read(getpwuid(getuid())) }
} else { } else {
possible_pw.unwrap() possible_pw.unwrap()
}; };
@ -273,7 +273,7 @@ fn pline(possible_pw: Option<c_passwd>) {
let pw_shell = unsafe { from_c_str(pw.pw_shell) }; let pw_shell = unsafe { from_c_str(pw.pw_shell) };
println!( println!(
"{:s}:{:s}:{:d}:{:d}:{:s}:{:d}:{:d}:{:s}:{:s}:{:s}", "{:s}:{:s}:{:u}:{:u}:{:s}:{:d}:{:d}:{:s}:{:s}:{:s}",
pw_name, pw_name,
pw_passwd, pw_passwd,
pw.pw_uid, pw.pw_uid,