Subject: | Possible issue with zero length files on Win32 when UNICODE is enabled |
This section of code in extractToFileNamed doesn't look right. I don't have a Win32 setup to test it, but my reading of the code suggests that a zero length file stored in a zip archive will not be unzipped correctly when $Archive::Zip::UNICODE has been set.
if ($^O eq 'MSWin32' && $Archive::Zip::UNICODE) {
$name = decode_utf8(Win32::GetFullPathName($name));
mkpath_win32($name);
if ($self->{'compressedSize'} == 0) {
return;
} else {
Win32::CreateFile($name);
}
I think that any leading path will get created ok (via mkpath_win32), but the test for compressedSize == 0 will prevent the zero length file from getting created.