Merge pull request #630 from davidgiven/brother

Fix some nasty Brother bugs.
This commit is contained in:
David Given
2022-12-02 22:20:32 +01:00
committed by GitHub
3 changed files with 16 additions and 5 deletions

View File

@@ -31,7 +31,18 @@ public:
{
ByteReader br(bytes);
filename = br.read(8);
filename = filename.substr(0, filename.find(' '));
for (int i = 0; filename.size(); i++)
{
if (filename[i] == ' ')
{
filename = filename.substr(0, i);
break;
}
if ((filename[i] < 32) || (filename[i] > 126))
throw BadFilesystemException();
}
path = {filename};
brotherType = br.read_8();
@@ -91,7 +102,7 @@ public:
for (int d = 0; d < SECTOR_SIZE / 16; d++)
{
Bytes buffer = bytes.slice(d * 16, 16);
if (buffer[0] == 0xf0)
if (buffer[0] & 0x80)
continue;
auto de = std::make_shared<Brother120Dirent>(buffer);

View File

@@ -18,7 +18,7 @@ layout {
physical {
start_sector: 0
count: 12
skew: 5
#skew: 5
}
}
}

View File

@@ -18,7 +18,7 @@ layout {
physical {
start_sector: 0
count: 12
skew: 5
#skew: 5
}
}
}
@@ -32,7 +32,7 @@ decoder {
}
drive {
head_bias: 1
head_bias: 3
}
filesystem {