diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2020-04-23 00:17:34 +0200 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2020-04-23 00:17:34 +0200 |
| commit | c07d040476ad052aa1961f1029082ad0f7b76039 (patch) | |
| tree | 681849469dbb96e0187bc20512b292f0dae3cbc6 /src | |
| parent | 202ca5e742967ad8afcd47511fdd640b37f07843 (diff) | |
| download | cc4group-c07d040476ad052aa1961f1029082ad0f7b76039.tar.gz cc4group-c07d040476ad052aa1961f1029082ad0f7b76039.zip | |
Fix nested cc4group.openAsChild
Diffstat (limited to 'src')
| -rw-r--r-- | src/cc4group.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/cc4group.c b/src/cc4group.c index ff42e51..a92b2b9 100644 --- a/src/cc4group.c +++ b/src/cc4group.c @@ -683,6 +683,12 @@ static bool cc4group_uncompressUntilPosition(CC4Group* const this, size_t const rootGroup->readState.position = position; } + + // update for child groups + if(this != rootGroup) + { + this->readState.position = position; + } return true; } @@ -3276,15 +3282,13 @@ static bool cc4group_openAsChildOn(CC4Group* const this, const char* const path, GroupEntryList* children = cc4group_getChildren(this, entry); // this also loads the header of entry child->root = *entry; + child->readState.position = this->readState.position; child->root.parent = NULL; child->root.core.FileName[0] = '\0'; child->root.children = children; child->uncompressedData = this->uncompressedData; - if(child->root.children == NULL) - { - return false; - } + assert(child->root.children); child->parent = this; child->name = strdup(entry->core.FileName); |
