mirror of https://github.com/stella-emu/stella.git
Fixed games count when there is no parent directory (fixes #807)
This commit is contained in:
parent
91786be2d9
commit
0c22737e64
|
@ -284,7 +284,7 @@ void ZipHandler::ZipFile::readEcd()
|
||||||
|
|
||||||
// Find the ECD signature
|
// Find the ECD signature
|
||||||
Int32 offset;
|
Int32 offset;
|
||||||
for(offset = Int32(buflen - EcdReader::minimumLength()); offset >= 0; --offset)
|
for(offset = Int32(buflen - EcdReader::minimumLength()); offset >= 0; --offset)
|
||||||
{
|
{
|
||||||
EcdReader reader(buffer.get() + offset);
|
EcdReader reader(buffer.get() + offset);
|
||||||
if(reader.signatureCorrect() && ((reader.totalLength() + offset) <= buflen))
|
if(reader.signatureCorrect() && ((reader.totalLength() + offset) <= buflen))
|
||||||
|
@ -445,13 +445,13 @@ void ZipHandler::ZipFile::decompressDataType8(
|
||||||
uInt64 input_remaining = myHeader.compressedLength;
|
uInt64 input_remaining = myHeader.compressedLength;
|
||||||
|
|
||||||
// Reset the stream
|
// Reset the stream
|
||||||
z_stream stream;
|
z_stream stream;
|
||||||
stream.zalloc = Z_NULL;
|
stream.zalloc = Z_NULL;
|
||||||
stream.zfree = Z_NULL;
|
stream.zfree = Z_NULL;
|
||||||
stream.opaque = Z_NULL;
|
stream.opaque = Z_NULL;
|
||||||
stream.avail_in = 0;
|
stream.avail_in = 0;
|
||||||
stream.next_out = reinterpret_cast<Bytef *>(out.get());
|
stream.next_out = reinterpret_cast<Bytef *>(out.get());
|
||||||
stream.avail_out = uInt32(length); // TODO - use zip64
|
stream.avail_out = uInt32(length); // TODO - use zip64
|
||||||
|
|
||||||
// Initialize the decompressor
|
// Initialize the decompressor
|
||||||
int zerr = inflateInit2(&stream, -MAX_WBITS);
|
int zerr = inflateInit2(&stream, -MAX_WBITS);
|
||||||
|
|
|
@ -422,8 +422,9 @@ void LauncherDialog::updateUI()
|
||||||
myDir->setText(myList->currentDir().getShortPath());
|
myDir->setText(myList->currentDir().getShortPath());
|
||||||
|
|
||||||
// Indicate how many files were found
|
// Indicate how many files were found
|
||||||
|
bool hasParent = *myList->getList().begin() == " [..]";
|
||||||
ostringstream buf;
|
ostringstream buf;
|
||||||
buf << (myList->getList().size() - 1) << (myShortCount ? " found" : " items found");
|
buf << (myList->getList().size() - (hasParent ? 1 : 0)) << (myShortCount ? " found" : " items found");
|
||||||
myRomCount->setLabel(buf.str());
|
myRomCount->setLabel(buf.str());
|
||||||
|
|
||||||
// Update ROM info UI item
|
// Update ROM info UI item
|
||||||
|
|
Loading…
Reference in New Issue