Skip to content

Commit

Permalink
Update spacing for end-of-data
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Dec 9, 2024
1 parent 69c59b5 commit 2ef107d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cpp/devices/tape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,8 @@ SimhMetaData Tape::FindNextObject(object_type type, int32_t requested_count, boo
tape_position += IsRecord(meta_data) ? Pad(meta_data.value) + META_DATA_SIZE : 0;
}

if (type == scsi_type && requested_count <= 0) {
// For end-of-data the count is ignored
if (type == scsi_type && (type == object_type::end_of_data || requested_count <= 0)) {
return meta_data;
}

Expand Down
3 changes: 2 additions & 1 deletion cpp/test/tape_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,9 @@ TEST(TapeTest, Space6_simh)

Rewind(tape);

// Search for end-of-data
// Search for end-of-data, the count is ignored
controller->SetCdbByte(1, 0b011);
controller->SetCdbByte(4, 10);
EXPECT_NO_THROW(Dispatch(tape, scsi_command::space_6));
CheckPositions(tape, 24, 6);

Expand Down

0 comments on commit 2ef107d

Please sign in to comment.