Fixed bug with .zip files without dir info. (#440)
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1103 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -245,16 +245,6 @@ zip_stat(uio_PDirHandle *pDirHandle, const char *name, struct stat *statBuf) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if zip_USE_HEADERS == zip_USE_CENTRAL_HEADERS
|
|
||||||
if (((zip_GPFileData *) entry->extra)->fileOffset == -1) {
|
|
||||||
// The local header wasn't read in yet.
|
|
||||||
if (zip_updateFileDataFromLocalHeader(pDirHandle->pRoot->handle,
|
|
||||||
(zip_GPFileData *) entry->extra) == -1) {
|
|
||||||
// errno is set
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (uio_GPDirEntry_isDir(entry) && entry->extra == NULL) {
|
if (uio_GPDirEntry_isDir(entry) && entry->extra == NULL) {
|
||||||
// No information about this directory was stored.
|
// No information about this directory was stored.
|
||||||
// We'll have to make something up.
|
// We'll have to make something up.
|
||||||
@@ -267,6 +257,17 @@ zip_stat(uio_PDirHandle *pDirHandle, const char *name, struct stat *statBuf) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if zip_USE_HEADERS == zip_USE_CENTRAL_HEADERS
|
||||||
|
if (((zip_GPFileData *) entry->extra)->fileOffset == -1) {
|
||||||
|
// The local header wasn't read in yet.
|
||||||
|
if (zip_updateFileDataFromLocalHeader(pDirHandle->pRoot->handle,
|
||||||
|
(zip_GPFileData *) entry->extra) == -1) {
|
||||||
|
// errno is set
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
zip_fillStat(statBuf, (zip_GPFileData *) entry->extra);
|
zip_fillStat(statBuf, (zip_GPFileData *) entry->extra);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user