Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Archive-Zip CPAN distribution.

Report information
The Basics
Id:
130507
Status:
new
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
johannes.ernst [...] gmail.com
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



Subject: Missing return value in Archive::Zip::Member::extractToFileNamed
Date: Sat, 14 Sep 2019 19:58:49 -0700
To: bug-Archive-Zip@rt.cpan.org
From: Johannes Ernst <johannes.ernst@gmail.com>
One of the two main branches of the code does not have a return value. Probably an oversight. Here’s the code, look for ===>>> sub extractToFileNamed { my $self = shift; # local FS name my $name = (ref($_[0]) eq 'HASH') ? $_[0]->{name} : $_[0]; $self->{'isSymbolicLink'} = 0; # Check if the file / directory is a symbolic link or not if ($self->{'externalFileAttributes'} == 0xA1FF0000) { $self->{'isSymbolicLink'} = 1; $self->{'newName'} = $name; my ($status, $fh) = _newFileHandle($name, 'r'); my $retval = $self->extractToFileHandle($fh); $fh->close(); ===>>> this should say: return $retval } else { #return _writeSymbolicLink($self, $name) if $self->isSymbolicLink(); my ($status, $fh); if ($^O eq 'MSWin32' && $Archive::Zip::UNICODE) { $name = decode_utf8(Win32::GetFullPathName($name)); mkpath_win32($name); Win32::CreateFile($name); ($status, $fh) = _newFileHandle(Win32::GetANSIPathName($name), 'w'); } else { mkpath(dirname($name)); # croaks on error ($status, $fh) = _newFileHandle($name, 'w'); } return _ioError("Can't open file $name for write") unless $status; my $retval = $self->extractToFileHandle($fh); $fh->close(); chmod($self->unixFileAttributes(), $name) or return _error("Can't chmod() ${name}: $!"); utime($self->lastModTime(), $self->lastModTime(), $name); return $retval; } }


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.