mirror of
https://github.com/TomHarte/CLK.git
synced 2024-09-30 07:55:01 +00:00
Minor tweak to support zero-length files.
This commit is contained in:
parent
ca4df5dd61
commit
c58cdbf151
@ -185,7 +185,6 @@ std::unique_ptr<Catalogue> StaticAnalyser::Acorn::GetDFSCatalogue(const std::sha
|
|||||||
new_file.data.reserve((size_t)data_length);
|
new_file.data.reserve((size_t)data_length);
|
||||||
|
|
||||||
if(start_sector < 2) continue;
|
if(start_sector < 2) continue;
|
||||||
|
|
||||||
while(data_length > 0)
|
while(data_length > 0)
|
||||||
{
|
{
|
||||||
uint8_t sector = (uint8_t)(start_sector % 10);
|
uint8_t sector = (uint8_t)(start_sector % 10);
|
||||||
@ -198,8 +197,8 @@ std::unique_ptr<Catalogue> StaticAnalyser::Acorn::GetDFSCatalogue(const std::sha
|
|||||||
long length_from_sector = std::min(data_length, 256l);
|
long length_from_sector = std::min(data_length, 256l);
|
||||||
new_file.data.insert(new_file.data.end(), next_sector->data.begin(), next_sector->data.begin() + length_from_sector);
|
new_file.data.insert(new_file.data.end(), next_sector->data.begin(), next_sector->data.begin() + length_from_sector);
|
||||||
data_length -= length_from_sector;
|
data_length -= length_from_sector;
|
||||||
if(!data_length) catalogue->files.push_front(new_file);
|
|
||||||
}
|
}
|
||||||
|
if(!data_length) catalogue->files.push_front(new_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
return catalogue;
|
return catalogue;
|
||||||
|
Loading…
Reference in New Issue
Block a user