Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve extension parsing logic #330

Merged
merged 3 commits into from
Jan 3, 2023
Merged

improve extension parsing logic #330

merged 3 commits into from
Jan 3, 2023

Conversation

figsoda
Copy link
Member

@figsoda figsoda commented Jan 3, 2023

the two new functions are extracted for the --format feature I'm working on

this fixes the issue where ouch d ..gz and ouch d ...gz tries to delete the current and parent folder respectively, which can be very dangerous with --yes, the user will now not be allowed to do that as if the file doesn't have an extension

Copy link
Member

@marcospb19 marcospb19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! I'd never noticed that ..gz and ...gz could be problematic.

@marcospb19
Copy link
Member

This fixed an issue a friend had where decompressing file.cbz was impossible, because Ouch doesn't detect any known extensions but detects the ZIP format via MIME types, previously it would think the output folder should have the name file.cbz, replacing the input by the output.

@marcospb19
Copy link
Member

marcospb19 commented Jan 6, 2023

I've added this to the CHANGELOG in the bugfixes section for 0.4.1: Fixed overwriting archive file when decompressing archive detected with MIME types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants