mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-12-28 18:51:06 +00:00
Make the naming of variables more obvious.
This commit is contained in:
parent
1ab1f3f320
commit
586c7dd30b
@ -64,10 +64,11 @@ impl Attribute {
|
|||||||
let mut names = Vec::new();
|
let mut names = Vec::new();
|
||||||
let mut start = 0;
|
let mut start = 0;
|
||||||
for end in idx {
|
for end in idx {
|
||||||
|
let c_end = end + 1; // end of the c-string (including 0)
|
||||||
let size = unsafe {
|
let size = unsafe {
|
||||||
getxattr(
|
getxattr(
|
||||||
c_path.as_ptr(),
|
c_path.as_ptr(),
|
||||||
buf[start..end+1].as_ptr() as *const c_char,
|
buf[start..c_end].as_ptr() as *const c_char,
|
||||||
ptr::null_mut(), 0, 0, c_flags
|
ptr::null_mut(), 0, 0, c_flags
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
@ -81,7 +82,7 @@ impl Attribute {
|
|||||||
size: size as usize
|
size: size as usize
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
start = end + 1;
|
start = c_end;
|
||||||
}
|
}
|
||||||
Ok(names)
|
Ok(names)
|
||||||
} else {
|
} else {
|
||||||
|
@ -59,10 +59,11 @@ impl Attribute {
|
|||||||
let mut names = Vec::new();
|
let mut names = Vec::new();
|
||||||
let mut start = 0;
|
let mut start = 0;
|
||||||
for end in idx {
|
for end in idx {
|
||||||
|
let c_end = end + 1; // end of the c-string (including 0)
|
||||||
let size = unsafe {
|
let size = unsafe {
|
||||||
getxattr(
|
getxattr(
|
||||||
c_path.as_ptr(),
|
c_path.as_ptr(),
|
||||||
buf[start..end+1].as_ptr() as *const c_char,
|
buf[start..c_end].as_ptr() as *const c_char,
|
||||||
ptr::null_mut(), 0
|
ptr::null_mut(), 0
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
@ -72,7 +73,7 @@ impl Attribute {
|
|||||||
size: size as usize
|
size: size as usize
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
start = end + 1;
|
start = c_end;
|
||||||
}
|
}
|
||||||
Ok(names)
|
Ok(names)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user