Skip to content

Commit

Permalink
It turns out I wasn't handling 0 sector files correctly. These need t…
Browse files Browse the repository at this point in the history
…o be extracted.
  • Loading branch information
xsacha committed Aug 25, 2014
1 parent 65b3e3d commit f131376
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,8 @@ void InstallNet::restoreReply()
setNewLine("<br>While sending: " + _downgradeInfo.at(_downgradePos).split("/").last()+"<br>");
setNewLine("&nbsp;&nbsp;Error: " + errorText +"<br>");
setInstalling(false);
setDGProgress(-1);
setCurDGProgress(-1);
}
}
else if (xml.name() == "Progress")
Expand Down
7 changes: 2 additions & 5 deletions src/splitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,9 @@ void Splitter::extractDir(int nodenum, QString basedir, qint64 startPos, int tie
QString dir = QString(signedFile->read(count));
if (dir == "." || dir == "..")
continue;

qinode ind2 = createNode(inodenum, startPos);
// TODO: What does it mean when this happens?
if (ind2.sectors.count() == 0) {
qDebug() << "Unexpected sector count. File may be corrupt."
continue;
}

if (ind2.perms & QCFM_IS_DIRECTORY)
{
if (extractApps) {
Expand Down
5 changes: 5 additions & 0 deletions src/splitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,11 @@ public slots:
if (sector != -1)
ind.sectors.append(sector);
}
// No sectors appears to be caused by empty files. These need to be extracted
if (ind.sectors.count() == 0) {
ind.sectors.append(0);
}

stream >> ind.tiers;
return ind;
}
Expand Down

0 comments on commit f131376

Please sign in to comment.