* extfs/uzip: Update to version 1.4.0.

* extfs/README.uzip: Likewise.
This commit is contained in:
Pavel Roskin 2001-08-07 20:02:05 +00:00
parent ad3d69dfbb
commit f3e22063e1
3 changed files with 37 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2001-08-07 Oskar Liljeblad <osk@hem.passagen.se>
* extfs/uzip: Update to version 1.4.0.
* extfs/README.uzip: Likewise.
2001-08-06 Andrew V. Samoilov <kai@cmail.ru>
* smbfs.c: Eliminate smbfs_get_free_bucket_init. convert_path

View File

@ -28,6 +28,15 @@ otherwise:
History
=======
2001-08-07 Oskar Liljeblad <osk@hem.passagen.se>
* Release 1.4.0.
* Fixed so that files with filenames containing *, ?, [, ]
and \\ can be extracted or added to zip archives etc. These
characters has to be escaped once more, because Info-ZIP zip
and unzip interprets them as wildcards (despite the fact that
the shell already expands wildcards).
2001-03-01 Oskar Liljeblad <osk@hem.passagen.se>
* Release 1.3.0.
@ -107,6 +116,8 @@ Known problems and Unsupported features
Files added to the archive get listed with a+x permissions in MC.
This appears to be a problem with the MC extfs, and (probably) not uzip.
(It is only temporary though. When restarting MC and reading the
archive, the files will no longer be listed as executable.)
Extracted files do not have the same modification/access date as
in the archive. The same applies for permissions and ownership.

View File

@ -1,7 +1,7 @@
#! /usr/bin/perl -w
#
# zip file archive Virtual File System for Midnight Commander
# Version 1.3.0 (2001-03-01).
# Version 1.4.0 (2001-08-07).
#
# (C) 2000-2001 Oskar Liljeblad <osk@hem.passagen.se>.
#
@ -63,7 +63,7 @@ exit 1;
# Remove a file from the archive.
sub mczipfs_rm {
my ($qfile) = map (quotemeta, @_);
my ($qfile) = map { &zipquotemeta($_) } @_;
&checkargs(1, 'archive file', @_);
&safesystem("$cmd_delete $qarchive $qfile >/dev/null");
exit;
@ -74,7 +74,7 @@ sub mczipfs_rm {
# additional slash to the directory name to remove. I am not
# sure this is absolutely necessary, but it doesn't hurt.
sub mczipfs_rmdir {
my ($qfile) = map (quotemeta, @_);
my ($qfile) = map { &zipquotemeta($_) } @_;
&checkargs(1, 'archive directory', @_);
&safesystem("$cmd_delete $qarchive $qfile/ >/dev/null 2>&1", 12);
exit;
@ -84,7 +84,7 @@ sub mczipfs_rmdir {
# Note that we don't need to check if the file is a link,
# because mc apparently doesn't call copyout for symbolic links.
sub mczipfs_copyout {
my ($qafile, $qfsfile) = map (quotemeta, @_);
my ($qafile, $qfsfile) = map { &zipquotemeta($_) } @_;
&checkargs(1, 'archive file', @_);
&checkargs(2, 'local file', @_);
&safesystem("$cmd_extract $qarchive $qafile > $qfsfile 2>/dev/null", 11);
@ -164,7 +164,7 @@ sub mczipfs_linkout {
my ($afile, $fsfile) = @_;
&checkargs(1, 'archive file', @_);
&checkargs(2, 'local file', @_);
my ($qafile) = map (quotemeta, $afile);
my ($qafile) = map { &zipquotemeta($_) } $afile;
my $linkdest = &get_link_destination($afile);
symlink ($linkdest, $fsfile) || &croak("link $fsfile failed");
@ -175,7 +175,7 @@ sub mczipfs_linkout {
# archive.
sub get_link_destination {
my ($afile) = @_;
my ($qafile) = map (quotemeta, $afile);
my ($qafile) = map { &zipquotemeta($_) } $afile;
my $linkdest = safeticks("$cmd_extract $qarchive $qafile");
&croak ("extract failed", "link destination of $afile not found")
if (!defined $linkdest || $linkdest eq '');
@ -230,7 +230,7 @@ sub mczipfs_list {
sub mczipfs_run {
my ($afile) = @_;
&checkargs(1, 'archive file', @_);
my $qafile = quotemeta $afile;
my $qafile = &zipquotemeta($afile);
my $tmpdir = &mktmpdir();
my $tmpfile = File::Basename::basename($afile);
@ -398,3 +398,17 @@ sub checkargs {
my $desc = shift;
&croak('missing argument', $desc) if ($count-1 > $#_);
}
# Quote zip wildcard metacharacters. Unfortunately Info-ZIP zip and unzip
# on unix interpret some wildcards in filenames, despite the fact that
# the shell already does this. Thus this function.
sub zipquotemeta {
my ($name) = @_;
my $out = '';
for (my $c = 0; $c < length $name; $c++) {
my $ch = substr($name, $c, 1);
$out .= '\\' if (index('*?[]\\', $ch) != -1);
$out .= $ch;
}
return quotemeta($out);
}