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:
meep-eep
2003-08-21 15:52:09 +00:00
parent ed8d195bd0
commit 120522faac
+11 -10
View File
@@ -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) {
// No information about this directory was stored.
// We'll have to make something up.
@@ -267,6 +257,17 @@ zip_stat(uio_PDirHandle *pDirHandle, const char *name, struct stat *statBuf) {
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);
return 0;
}