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:
4674
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
JFITZ [...] cpan.org
Cc:
AdminCc:

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



Subject: overwrite method fails for archives without an extension
If one creates an Archive::Zip object for an archive that doesn't have an extension (say 'foo') then the overwrite() method deletes the file. The problem is the generation of the backup file name in overwriteAs(): ( my $backupName = $zipName ) =~ s{\.[^.]*$}{.zbk}; If $zipName doesn't match the substitution then $backupName keeps it's original state, which is the same as $zipName: Archive::Zip::Archive::overwriteAs(/usr/local/lib/perl5/site_perl/5.8.2/Archive/Zip.pm:762): 762: ( my $backupName = $zipName ) =~ s{\.[^.]*$}{.zbk}; DB<2> p $zipName foo DB<3> p $backupName foo DB<4> and since later on in the method $backupName is unlinked... kapoof goes the archive. This is probably not a common occurence (I only stumbled across it by accident), but a bit surprising I'm sure you'll agree. Regards.
[JFITZ - Sun Dec 14 13:30:48 2003]:
Show quoted text
> If one creates an Archive::Zip object for an archive that doesn't have > an extension (say 'foo') then the overwrite() method deletes the file. > > The problem is the generation of the backup file name in > overwriteAs(): > > ( my $backupName = $zipName ) =~ s{\.[^.]*$}{.zbk}; > > If $zipName doesn't match the substitution then $backupName keeps it's > original state, which is the same as $zipName: > >
Archive::Zip::Archive::overwriteAs(/usr/local/lib/perl5/site_perl/5.8.2/Archive/Zip.pm:762):
Show quoted text
> 762: ( my $backupName = $zipName ) =~ s{\.[^.]*$}{.zbk}; > DB<2> p $zipName > foo > DB<3> p $backupName > foo > DB<4> > > and since later on in the method $backupName is unlinked... kapoof > goes the archive. > > This is probably not a common occurence (I only stumbled across it by > accident), but a bit surprising I'm sure you'll agree. > > Regards.
Right. Thanks for sending this; it'll be fixed in the next release. Ned


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.