projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed compiler warning
[rocksndiamonds.git]
/
src
/
libgame
/
zip
/
ioapi.c
diff --git
a/src/libgame/zip/ioapi.c
b/src/libgame/zip/ioapi.c
index 5d9c10bd6ee04c3904ea70cd72116869756498ce..5a31fcbfdfb6ae598eed85bfe6c9ec6891baf21d 100644
(file)
--- a/
src/libgame/zip/ioapi.c
+++ b/
src/libgame/zip/ioapi.c
@@
-45,11
+45,11
@@
long call_zseek64(const zlib_filefunc64_32_def *pfilefunc, voidpf filestream, ui
{
uint32_t offset_truncated = 0;
if (pfilefunc->zfile_func64.zseek64_file != NULL)
{
uint32_t offset_truncated = 0;
if (pfilefunc->zfile_func64.zseek64_file != NULL)
- return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,
filestream,offset,
origin);
+ return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,
filestream, offset,
origin);
offset_truncated = (uint32_t)offset;
if (offset_truncated != offset)
return -1;
offset_truncated = (uint32_t)offset;
if (offset_truncated != offset)
return -1;
- return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream, offset_truncated, origin);
+ return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,
filestream, offset_truncated, origin);
}
uint64_t call_ztell64(const zlib_filefunc64_32_def *pfilefunc, voidpf filestream)
}
uint64_t call_ztell64(const zlib_filefunc64_32_def *pfilefunc, voidpf filestream)
@@
-121,7
+121,11
@@
static voidpf ZCALLBACK fopen64_file_func(ZIP_UNUSED voidpf opaque, const void *
if ((filename != NULL) && (mode_fopen != NULL))
{
if ((filename != NULL) && (mode_fopen != NULL))
{
- file = fopen64((const char*)filename, mode_fopen);
+ const char *fd_prefix = "fd:";
+ if (strncmp(filename, fd_prefix, strlen(fd_prefix)) == 0)
+ file = fdopen(dup(atoi(&((const char*)filename)[strlen(fd_prefix)])), mode_fopen);
+ else
+ file = fopen64((const char*)filename, mode_fopen);
return file_build_ioposix(file, (const char*)filename);
}
return file;
return file_build_ioposix(file, (const char*)filename);
}
return file;