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

Windows style path in .zip files #2171

Open
eXl5eQ opened this issue May 6, 2024 · 0 comments
Open

Windows style path in .zip files #2171

eXl5eQ opened this issue May 6, 2024 · 0 comments

Comments

@eXl5eQ
Copy link

eXl5eQ commented May 6, 2024

This commit adds code to convert Windows style path "" to "/" when writing an entry.

#if defined(_WIN32) && !defined(__CYGWIN__)
	/* Make sure the path separators in pahtname, hardlink and symlink
	 * are all slash '/', not the Windows path separator '\'. */
	l->entry = __la_win_entry_in_posix_pathseparator(entry);
	if (l->entry == entry)
		l->entry = archive_entry_clone(entry);
#else

Which looks fine. However, if a charset conversion is required, l->entry will later be overwrited by these code

if (sconv != NULL) {
	...
	if (archive_entry_pathname_l(entry, &p, &len, sconv) != 0) { ... }
	if (len > 0)
		archive_entry_set_pathname(l->entry, p);

Suggested fix:

Change the entry in archive_entry_pathname_l(entry, &p, &len, sconv) to l->entry (or zip->entry in latest version)

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

No branches or pull requests

1 participant