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

fix: unzipping with backslashes in the name on UNIX #834

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Coeur
Copy link
Contributor

@Coeur Coeur commented Nov 24, 2024

While #832 was for fixing zipping, this PR is for fixing unzipping.

The expectation is that archiving+unarchiving data on UNIX should preserve its structure, no matter if there are backslashes (or dots) in the name of files or folders.
So backslash should only be seen as a separator on Windows, never on UNIX filesystems.

This is the current behaviour with the default macOS /usr/bin/zip and /usr/bin/unzip as well as default behaviour in Finder when right-click -> compress, followed by double-click to uncompress.

@Coeur
Copy link
Contributor Author

Coeur commented Nov 24, 2024

OK, I guess I need to look at the unit tests.

@nmoinvaz
Copy link
Member

The thing I worry about is if the zip was improperly created in the Windows style of path slashes in the zip entry. It would unzip on Unix anymore.

@Coeur
Copy link
Contributor Author

Coeur commented Nov 25, 2024

Do we have Windows sample archives like that? As written in 4.4.17.1, it would not have been allowed in the first place.

OK, here is what I suggest: a compile option just like I did in #804 with MZ_TARGET_APPSTORE. Flipping such new compile option would allow for either behaviour.

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