Index: src/OFZooArchiveEntry.h ================================================================== --- src/OFZooArchiveEntry.h +++ src/OFZooArchiveEntry.h @@ -40,10 +40,11 @@ unsigned long long _uncompressedSize, _compressedSize; bool _deleted; OFString *_Nullable _fileComment; OFString *_fileName, *_Nullable _directoryName; OFNumber *_Nullable _POSIXPermissions; + uint8_t _timeZone; OF_RESERVE_IVARS(OFZooArchiveEntry, 4) } /** * @brief The compression method of the entry. Index: src/OFZooArchiveEntry.m ================================================================== --- src/OFZooArchiveEntry.m +++ src/OFZooArchiveEntry.m @@ -81,12 +81,11 @@ uint8_t fileNameLength, directoryNameLength; if (extraLength < 10) @throw [OFInvalidFormatException exception]; - /* Time zone */ - [stream readInt8]; + _timeZone = [stream readInt8]; /* CRC16 of the header */ [stream readLittleEndianInt16]; fileNameLength = [stream readInt8]; directoryNameLength = [stream readInt8]; @@ -137,14 +136,16 @@ initWithUnsignedShort: mode]; } extraLength -= 3; } - } else + } else { _fileName = [[OFString alloc] initWithCString: fileNameBuffer encoding: encoding]; + _timeZone = 0x7F; + } if (commentOffset != 0) { [stream seekToOffset: commentOffset whence: OFSeekSet]; _fileComment = [[stream readStringWithLength: commentLength @@ -197,12 +198,20 @@ dateString = [OFString stringWithFormat: @"%04u-%02u-%02u %02u:%02u:%02u", year, month, day, hour, minute, second]; - date = [[OFDate alloc] initWithLocalDateString: dateString - format: @"%Y-%m-%d %H:%M:%S"]; + if (_timeZone == 0x7F) + date = [[OFDate alloc] + initWithLocalDateString: dateString + format: @"%Y-%m-%d %H:%M:%S"]; + else { + date = [OFDate dateWithDateString: dateString + format: @"%Y-%m-%d %H:%M:%S"]; + date = [[date dateByAddingTimeInterval: + -(OFTimeInterval)_timeZone * 900] retain]; + } objc_autoreleasePoolPop(pool); return [date autorelease]; } @@ -209,11 +218,11 @@ - (OFString *)description { void *pool = objc_autoreleasePoolPush(); OFString *ret = [OFString stringWithFormat: - @"<%@: \n" + @"<%@:\n" @"\tFile name = %@\n" @"\tFile comment = %@\n" @"\tCompressed size = %llu\n" @"\tUncompressed size = %llu\n" @"\tCompression method = %u\n"