mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-05 20:37:52 +00:00
Merge branch 'master' of github.com:ogham/exa
Conflicts: unix.rs
This commit is contained in:
commit
03bf728a1e
17
unix.rs
17
unix.rs
@ -123,22 +123,13 @@ impl Unix {
|
|||||||
pub fn load_group(&mut self, gid: u32) {
|
pub fn load_group(&mut self, gid: u32) {
|
||||||
match unsafe { c::getgrgid(gid).to_option() } {
|
match unsafe { c::getgrgid(gid).to_option() } {
|
||||||
None => {
|
None => {
|
||||||
self.group_names.insert(gid, None);
|
self.group_names.find_or_insert(gid, None);
|
||||||
self.groups.insert(gid, false);
|
self.groups.find_or_insert(gid, false);
|
||||||
},
|
},
|
||||||
Some(r) => {
|
Some(r) => {
|
||||||
let group_name = unsafe { Some(from_c_str(r.gr_name)) };
|
let group_name = unsafe { Some(from_c_str(r.gr_name)) };
|
||||||
self.group_names.insert(gid, group_name.clone());
|
self.groups.find_or_insert(gid, Unix::group_membership(r.gr_mem, &self.username));
|
||||||
|
self.group_names.find_or_insert(gid, group_name);
|
||||||
// Calculate whether we are a member of the
|
|
||||||
// group. Now's as good a time as any as we've
|
|
||||||
// just retrieved the group details.
|
|
||||||
|
|
||||||
if !self.groups.contains_key(&gid) {
|
|
||||||
self.groups.insert(gid, Unix::group_membership(r.gr_mem, &self.username));
|
|
||||||
}
|
|
||||||
|
|
||||||
self.group_names.insert(gid, group_name);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user