mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-05 02:55:31 +00:00
Fix .zip
crash when file mode isn't present (#804)
This commit is contained in:
parent
739dfa9507
commit
0b122fa05c
@ -23,6 +23,9 @@ Categories Used:
|
|||||||
### New Features
|
### New Features
|
||||||
### Improvements
|
### Improvements
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Fix .zip crash when file mode isn't present [\#804](https://github.com/ouch-org/ouch/pull/804) ([marcospb19](https://github.com/marcospb19))
|
||||||
|
|
||||||
### Tweaks
|
### Tweaks
|
||||||
|
|
||||||
## [0.6.0](https://github.com/ouch-org/ouch/compare/0.5.1...0.6.0)
|
## [0.6.0](https://github.com/ouch-org/ouch/compare/0.5.1...0.6.0)
|
||||||
|
@ -85,10 +85,8 @@ where
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
let mode = file.unix_mode().ok_or_else(|| {
|
let mode = file.unix_mode();
|
||||||
std::io::Error::new(std::io::ErrorKind::InvalidData, "Cannot extract file's mode")
|
let is_symlink = mode.is_some_and(|mode| mode & 0o170000 == 0o120000);
|
||||||
})?;
|
|
||||||
let is_symlink = (mode & 0o170000) == 0o120000;
|
|
||||||
|
|
||||||
if is_symlink {
|
if is_symlink {
|
||||||
let mut target = String::new();
|
let mut target = String::new();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user