Fixed a bug that cropped up when trying to add files after deleting all

existing entries.
This commit is contained in:
Andy McFadden 2004-09-26 00:59:28 +00:00
parent 1ba9153d5c
commit c72e15d854
3 changed files with 9 additions and 6 deletions

View File

@ -1,3 +1,7 @@
2004/09/25 fadden
- Fixed: attempting to add files after deleting *all* entries in an
archive would fail.
2004/09/20 fadden
- Corrected behavior after flush when original archive can't be
deleted.

View File

@ -1218,7 +1218,7 @@ Nu_ConstructArchiveRecord(NuArchive* pArchive, NuRecord* pRecord)
err = Nu_WriteRecordHeader(pArchive, pRecord, pArchive->tmpFp);
BailError(err);
Assert(newHeaderSize == pRecord->recHeaderLength);
Assert(newHeaderSize == (int) pRecord->recHeaderLength);
/*
* Seek forward once again, so we are positioned at the correct

View File

@ -541,13 +541,9 @@ Nu_RecordSet_MoveAllRecords(NuArchive* pArchive, NuRecordSet* pDstSet,
Assert(pDstSet != nil);
Assert(pSrcSet != nil);
#if 0 /* this is bogus -- empty set != unloaded set */
if (!Nu_RecordSet_GetNumRecords(pSrcSet)) /* nothing to do? */
return kNuErrNone;
#endif
/* move records over */
if (Nu_RecordSet_GetNumRecords(pSrcSet)) {
Assert(pSrcSet->loaded);
Assert(pSrcSet->nuRecordHead != nil);
Assert(pSrcSet->nuRecordTail != nil);
if (pDstSet->nuRecordHead == nil) {
@ -569,6 +565,9 @@ Nu_RecordSet_MoveAllRecords(NuArchive* pArchive, NuRecordSet* pDstSet,
/* no records in src set */
Assert(pSrcSet->nuRecordHead == nil);
Assert(pSrcSet->nuRecordTail == nil);
if (pSrcSet->loaded)
pDstSet->loaded = true;
}
/* nuke all pointers in original list */