From 1f8cbdd360a3f5a9aec7db100cac25172f670a27 Mon Sep 17 00:00:00 2001 From: figsoda Date: Thu, 1 Sep 2022 14:24:49 -0400 Subject: [PATCH 1/2] fix: incorrect warnings for decompression --- src/commands/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 133d14e..9236a25 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -381,7 +381,10 @@ fn check_mime_type( // File ending with extension // Try to detect the extension and warn the user if it differs from the written one let outer_ext = format.iter().next_back().unwrap(); - if outer_ext != &detected_format { + if !outer_ext + .compression_formats + .ends_with(detected_format.compression_formats) + { warning!( "The file extension: `{}` differ from the detected extension: `{}`", outer_ext, From dcf86f7e1ad8fdbe1556c52d95c98fc5bce04435 Mon Sep 17 00:00:00 2001 From: figsoda Date: Thu, 1 Sep 2022 14:30:05 -0400 Subject: [PATCH 2/2] chore: add CHANGELOG.md entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 145fcc6..19ef66c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -126,6 +126,7 @@ Categories Used: - Fix wrong archive format detection patterns [\#125](https://github.com/ouch-org/ouch/pull/125) ([SpyrosRoum](https://github.com/SpyrosRoum)) - Decompressing file without extension gives bad error message [\#137](https://github.com/ouch-org/ouch/issues/137) ([marcospb19](https://github.com/marcospb19)) - Fix decompression overwritting files without asking and failing on directories [\#141](https://github.com/ouch-org/ouch/pull/141) ([SpyrosRoum](https://github.com/SpyrosRoum)) +- Fix incorrect warnings for decompression [\#270](https://github.com/ouch-org/ouch/pull/270) ([figsoda](https://github.com/figsoda)) ### Improvements