mirror of
https://github.com/open-goal/jak-project
synced 2026-05-28 08:25:56 -04:00
fix zip library bugs (#508)
This commit is contained in:
@@ -166,6 +166,10 @@ ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
||||
#define COPY 1 /* copy input directly */
|
||||
#define GZIP 2 /* decompress a gzip stream */
|
||||
|
||||
#ifdef __unix__
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* internal gzip file state data structure */
|
||||
typedef struct
|
||||
{
|
||||
|
||||
+2
-1
@@ -52,6 +52,7 @@
|
||||
#else
|
||||
# include <unistd.h>
|
||||
# include <utime.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -99,7 +100,7 @@ tm_unz tmu_date;
|
||||
SetFileTime(hFile, &ftm, &ftLastAcc, &ftm);
|
||||
CloseHandle(hFile);
|
||||
#else
|
||||
#ifdef unix || __APPLE__
|
||||
#if defined unix || defined __APPLE__
|
||||
struct utimbuf ut;
|
||||
struct tm newdate;
|
||||
newdate.tm_sec = tmu_date.tm_sec;
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ uLong* dt; /* dostime */
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
#ifdef unix || __APPLE__
|
||||
#if defined unix || defined __APPLE__
|
||||
uLong filetime(f, tmzip, dt)
|
||||
char *f; /* name of file to get info on */
|
||||
tm_zip *tmzip; /* return value: access, modific. and creation times */
|
||||
|
||||
Vendored
+3
-2
@@ -2,6 +2,7 @@
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
#include <ctime>
|
||||
#include <cstring>
|
||||
|
||||
#include <minizip/zlib.h>
|
||||
|
||||
@@ -74,7 +75,8 @@ namespace ziputils
|
||||
}
|
||||
|
||||
//?? we dont need the stinking time
|
||||
zip_fileinfo zi = {0};
|
||||
zip_fileinfo zi;
|
||||
memset(&zi, 0, sizeof(zi));
|
||||
getTime(zi.tmz_date);
|
||||
|
||||
int err = zipOpenNewFileInZip(zipFile_, filename, &zi,
|
||||
@@ -109,7 +111,6 @@ namespace ziputils
|
||||
{
|
||||
int err = ZIP_OK;
|
||||
char buf[BUFSIZE];
|
||||
unsigned long nRead = 0;
|
||||
|
||||
if (isOpenEntry())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user