fix: 7zip shows different error messages for RAR and ZIP files (#1468)

This commit is contained in:
三咲雅 · Misaki Masa 2024-08-11 17:30:52 +08:00 committed by sxyazi
parent 44f45fd8e1
commit a39409e699
No known key found for this signature in database
9 changed files with 30 additions and 31 deletions

33
Cargo.lock generated
View File

@ -343,9 +343,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.1.6"
version = "1.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f"
checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc"
dependencies = [
"jobserver",
"libc",
@ -381,9 +381,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.5.13"
version = "4.5.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc"
checksum = "11d8838454fda655dafd3accb2b6e2bea645b9e4078abe84a22ceb947235c5cc"
dependencies = [
"clap_builder",
"clap_derive",
@ -391,9 +391,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.13"
version = "4.5.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99"
checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6"
dependencies = [
"anstream",
"anstyle",
@ -403,9 +403,9 @@ dependencies = [
[[package]]
name = "clap_complete"
version = "4.5.12"
version = "4.5.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8670053e87c316345e384ca1f3eba3006fc6355ed8b8a1140d104e109e3df34"
checksum = "1d11bff0290e9a266fc9b4ce6fa96c2bf2ca3f9724c41c10202ac1daf7a087f8"
dependencies = [
"clap",
]
@ -2126,9 +2126,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "serde"
version = "1.0.204"
version = "1.0.206"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12"
checksum = "5b3e4cd94123dd520a128bcd11e34d9e9e423e7e3e50425cb1b4b1e3549d0284"
dependencies = [
"serde_derive",
]
@ -2145,9 +2145,9 @@ dependencies = [
[[package]]
name = "serde_derive"
version = "1.0.204"
version = "1.0.206"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
checksum = "fabfb6138d2383ea8208cf98ccf69cdfb1aff4088460681d84189aa259762f97"
dependencies = [
"proc-macro2",
"quote",
@ -2156,9 +2156,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.122"
version = "1.0.124"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da"
checksum = "66ad62847a56b3dba58cc891acd13884b9c61138d330c0d7b6181713d4fce38d"
dependencies = [
"itoa",
"memchr",
@ -2655,9 +2655,9 @@ dependencies = [
[[package]]
name = "trash"
version = "5.0.0"
version = "5.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d8fbfb70b1fad5c0b788f9b2e1bf4d04e5ac6efa828f1ed9ee462c50ff9cf05"
checksum = "a154e8323dbd402514d5a3c0f12e0a5bddf72de674b565d58a5535500566428b"
dependencies = [
"chrono",
"libc",
@ -3292,7 +3292,6 @@ dependencies = [
"ratatui",
"scopeguard",
"serde",
"shell-words",
"tokio",
"tokio-stream",
"tokio-util",

View File

@ -15,7 +15,7 @@ anyhow = "1.0.86"
arc-swap = "1.7.1"
base64 = "0.22.1"
bitflags = "2.6.0"
clap = { version = "4.5.13", features = [ "derive" ] }
clap = { version = "4.5.15", features = [ "derive" ] }
crossterm = { version = "0.27.0", features = [ "event-stream" ] }
dirs = "5.0.1"
futures = "0.3.30"
@ -27,8 +27,8 @@ parking_lot = "0.12.3"
ratatui = "0.27.0"
regex = "1.10.6"
scopeguard = "1.2.0"
serde = { version = "1.0.204", features = [ "derive" ] }
serde_json = "1.0.122"
serde = { version = "1.0.206", features = [ "derive" ] }
serde_json = "1.0.124"
shell-words = "1.1.0"
tokio = { version = "1.39.2", features = [ "full" ] }
tokio-stream = "0.1.15"

View File

@ -20,7 +20,7 @@ serde = { workspace = true }
[build-dependencies]
clap = { workspace = true }
clap_complete = "4.5.12"
clap_complete = "4.5.14"
clap_complete_fig = "4.5.2"
clap_complete_nushell = "4.5.3"
vergen-gitcl = { version = "1.0.0", features = [ "build" ] }

View File

@ -28,7 +28,7 @@ yazi-shared = { path = "../yazi-shared", version = "0.3.0" }
# External build dependencies
anyhow = { workspace = true }
clap = { workspace = true }
clap_complete = "4.5.12"
clap_complete = "4.5.14"
clap_complete_fig = "4.5.2"
clap_complete_nushell = "4.5.3"
serde_json = { workspace = true }

View File

@ -30,7 +30,6 @@ parking_lot = { workspace = true }
ratatui = { workspace = true }
scopeguard = { workspace = true }
serde = { workspace = true }
shell-words = { workspace = true }
tokio = { workspace = true }
tokio-stream = { workspace = true }
tokio-util = { workspace = true }

View File

@ -28,7 +28,7 @@ impl Manager {
// Hover on the file
render!(self.current_or_mut(opt.tab).repos(opt.url.as_ref()));
if opt.url.zip(self.current().hovered()).is_some_and(|(u, f)| u == f.url) {
if opt.url.zip(self.current_or(opt.tab).hovered()).is_some_and(|(u, f)| u == f.url) {
// `hover(Some)` occurs after user actions, such as create, rename, reveal, etc.
// At this point, it's intuitive to track the location of this file regardless.
self.current_or_mut(opt.tab).tracing = true;

View File

@ -69,7 +69,6 @@ impl State {
state.sort_unstable_by(|(a, _), (b, _)| a.cmp(b));
for (_, v) in state {
buf.write_all(v.as_bytes()).await?;
buf.write_u8(b'\n').await?;
}
buf.flush().await?;
@ -77,15 +76,17 @@ impl State {
}
async fn load(&self) -> Result<()> {
let mut buf = BufReader::new(File::open(BOOT.state_dir.join(".dds")).await?);
let mut line = String::new();
let mut file = BufReader::new(File::open(BOOT.state_dir.join(".dds")).await?);
let mut buf = String::new();
let mut inner = HashMap::new();
while buf.read_line(&mut line).await? > 0 {
while file.read_line(&mut buf).await? > 0 {
let line = mem::take(&mut buf);
let mut parts = line.splitn(4, ',');
let Some(kind) = parts.next() else { continue };
let Some(_) = parts.next() else { continue };
inner.insert(kind.to_owned(), mem::take(&mut line));
inner.insert(kind.to_owned(), line);
}
let clients = CLIENTS.read();

View File

@ -137,6 +137,6 @@ function M:list_files(args, skip, limit)
return files, i, code
end
function M:is_encrypted(s) return s:find(". Wrong password?", 1, true) end
function M:is_encrypted(s) return s:find(" Wrong password", 1, true) end
return M

View File

@ -28,4 +28,4 @@ tracing = { workspace = true }
libc = { workspace = true }
[target.'cfg(not(target_os = "android"))'.dependencies]
trash = "5.0.0"
trash = "5.1.0"