diff --git a/nufxlib-0/Record.c b/nufxlib-0/Record.c index 82d8523..a143b8d 100644 --- a/nufxlib-0/Record.c +++ b/nufxlib-0/Record.c @@ -1053,6 +1053,7 @@ Nu_ReadRecordHeader(NuArchive* pArchive, NuRecord* pRecord) pRecord->recHeaderLength = bytesRead + pRecord->recTotalThreads * kNuThreadHeaderSize; + pRecord->recHeaderLength -= pRecord->fakeThreads * kNuThreadHeaderSize; err = Nu_ComputeThreadData(pArchive, pRecord); BailError(err); @@ -1267,6 +1268,7 @@ Nu_WriteRecordHeader(NuArchive* pArchive, NuRecord* pRecord, FILE* fp) */ pRecord->recHeaderLength = bytesWritten + pRecord->recTotalThreads * kNuThreadHeaderSize; + pRecord->recHeaderLength -= pRecord->fakeThreads * kNuThreadHeaderSize; err = Nu_ComputeThreadData(pArchive, pRecord); BailError(err); @@ -1738,11 +1740,10 @@ Nu_ExtractRecordByPtr(NuArchive* pArchive, NuRecord* pRecord) * thread at all. It doesn't correctly deal with them when extracting * though, so it appears this behavior wasn't entirely expected.) * - * NOTE: this might be doing the (slightly) wrong thing if the storage - * type of the file indicates that it was forked. We might need to be - * extracting zero-byte data *and* resource forks here. Only matters - * if we want to be able to reconstruct the original archive contents - * from what we extracted. ++ATM 20030110 + * If it's a forked file, we also need to create an empty rsrc file. + * + * If valMaskDataless is enabled, this won't fire, because we "forge" + * appropriate threads. * * Note there's another one of these below, in Nu_StreamExtract. */ diff --git a/nufxlib-0/Thread.c b/nufxlib-0/Thread.c index da445d5..a6eadb4 100644 --- a/nufxlib-0/Thread.c +++ b/nufxlib-0/Thread.c @@ -279,7 +279,7 @@ Nu_ReadThreadHeaders(NuArchive* pArchive, NuRecord* pRecord, ushort* pCrc) pThread->thCompThreadEOF = 0; pThread->actualThreadEOF = 0; pThread->threadIdx = Nu_GetNextThreadIdx(pArchive); - pThread->fileOffset = -1; + pThread->fileOffset = -99999999; if (needRsrc) { pThread++; @@ -291,7 +291,7 @@ Nu_ReadThreadHeaders(NuArchive* pArchive, NuRecord* pRecord, ushort* pCrc) pThread->thCompThreadEOF = 0; pThread->actualThreadEOF = 0; pThread->threadIdx = Nu_GetNextThreadIdx(pArchive); - pThread->fileOffset = -1; + pThread->fileOffset = -99999999; } }