mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-23 00:17:42 +00:00
Correct cpio's norm_path
This commit is contained in:
parent
d9b67a207b
commit
6f6b0ade06
@ -620,11 +620,10 @@ fn align_4(x: usize) -> usize {
|
|||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn norm_path(path: &str) -> String {
|
fn norm_path(path: &str) -> String {
|
||||||
path.strip_prefix('/')
|
path.split('/')
|
||||||
.unwrap_or(path)
|
.filter(|x| !x.is_empty())
|
||||||
.strip_suffix('/')
|
.intersperse("/")
|
||||||
.unwrap_or(path)
|
.collect()
|
||||||
.to_string()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_mode(s: &str) -> Result<mode_t, String> {
|
fn parse_mode(s: &str) -> Result<mode_t, String> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user