aboutsummaryrefslogtreecommitdiff
path: root/src/common/unzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/unzip.c')
-rw-r--r--src/common/unzip.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/common/unzip.c b/src/common/unzip.c
index 553ae6a..0795658 100644
--- a/src/common/unzip.c
+++ b/src/common/unzip.c
@@ -18,6 +18,12 @@
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* This code is based in part on
22 unzip 1.00 Copyright 1998-2003 Gilles Vollant
23 http://www.winimage.com/zLibDll"
24*/
25
26
21#include "platform.h" 27#include "platform.h"
22#include <ctype.h> 28#include <ctype.h>
23#include "extractor.h" 29#include "extractor.h"
@@ -94,8 +100,6 @@ typedef struct unz_global_info_s
94#define SIZEZIPLOCALHEADER (0x1e) 100#define SIZEZIPLOCALHEADER (0x1e)
95 101
96 102
97const char unz_copyright[] =
98 " unzip 1.00 Copyright 1998-2003 Gilles Vollant - http://www.winimage.com/zLibDll";
99 103
100/* EXTRACTOR_unzip_file_info_interntal contain internal info about a file in zipfile*/ 104/* EXTRACTOR_unzip_file_info_interntal contain internal info about a file in zipfile*/
101typedef struct unz_file_info_internal_s 105typedef struct unz_file_info_internal_s
@@ -583,8 +587,6 @@ EXTRACTOR_common_unzip_open2 (const char *path,
583 587
584 int err=EXTRACTOR_UNZIP_OK; 588 int err=EXTRACTOR_UNZIP_OK;
585 589
586 if (unz_copyright[0]!=' ')
587 return NULL;
588 memset (&us, 0, sizeof(us)); 590 memset (&us, 0, sizeof(us));
589 us.z_filefunc = *pzlib_filefunc_def; 591 us.z_filefunc = *pzlib_filefunc_def;
590 592
@@ -1007,7 +1009,7 @@ unzlocal_CheckCurrentFileCoherencyHeader (unz_s* s,
1007 uLong uMagic,uData,uFlags; 1009 uLong uMagic,uData,uFlags;
1008 uLong size_filename; 1010 uLong size_filename;
1009 uLong size_extra_field; 1011 uLong size_extra_field;
1010 int err=EXTRACTOR_UNZIP_OK; 1012 int err = EXTRACTOR_UNZIP_OK;
1011 1013
1012 *piSizeVar = 0; 1014 *piSizeVar = 0;
1013 *poffset_local_extrafield = 0; 1015 *poffset_local_extrafield = 0;
@@ -1015,21 +1017,13 @@ unzlocal_CheckCurrentFileCoherencyHeader (unz_s* s,
1015 1017
1016 if (ZSEEK(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + 1018 if (ZSEEK(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile +
1017 s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) 1019 s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0)
1018 return EXTRACTOR_UNZIP_ERRNO; 1020 return EXTRACTOR_UNZIP_ERRNO;
1019 1021 if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != EXTRACTOR_UNZIP_OK)
1020 1022 err=EXTRACTOR_UNZIP_ERRNO;
1021 if (err==EXTRACTOR_UNZIP_OK) { 1023 else if (uMagic!=0x04034b50)
1022 if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != EXTRACTOR_UNZIP_OK) 1024 err=EXTRACTOR_UNZIP_BADZIPFILE;
1023 err=EXTRACTOR_UNZIP_ERRNO;
1024 else if (uMagic!=0x04034b50)
1025 err=EXTRACTOR_UNZIP_BADZIPFILE;
1026 }
1027 if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != EXTRACTOR_UNZIP_OK) 1025 if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != EXTRACTOR_UNZIP_OK)
1028 err=EXTRACTOR_UNZIP_ERRNO; 1026 err=EXTRACTOR_UNZIP_ERRNO;
1029/*
1030 else if ((err==EXTRACTOR_UNZIP_OK) && (uData!=s->cur_file_info.wVersion))
1031 err=EXTRACTOR_UNZIP_BADZIPFILE;
1032*/
1033 if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uFlags) != EXTRACTOR_UNZIP_OK) 1027 if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uFlags) != EXTRACTOR_UNZIP_OK)
1034 err=EXTRACTOR_UNZIP_ERRNO; 1028 err=EXTRACTOR_UNZIP_ERRNO;
1035 1029