diff --git a/flang/runtime/internal-unit.cpp b/flang/runtime/internal-unit.cpp index aa7130f3a6a53..e3fffaa6f378f 100644 --- a/flang/runtime/internal-unit.cpp +++ b/flang/runtime/internal-unit.cpp @@ -43,11 +43,9 @@ InternalDescriptorUnit::InternalDescriptorUnit( template void InternalDescriptorUnit::EndIoStatement() { if constexpr (DIR == Direction::Output) { - // Clear the remainder of the current record if anything was written - // to it, or if it is the only record. + // Clear the remainder of the current record. auto end{endfileRecordNumber.value_or(0)}; - if (currentRecordNumber < end && - (end == 2 || furthestPositionInRecord > 0)) { + if (currentRecordNumber < end) { BlankFillOutputRecord(); } }