diff --git a/flang/runtime/io-stmt.cpp b/flang/runtime/io-stmt.cpp --- a/flang/runtime/io-stmt.cpp +++ b/flang/runtime/io-stmt.cpp @@ -325,10 +325,9 @@ if (mutableModes().nonAdvancing) { // Make effects of positioning past the last Emit() visible with blanks. std::int64_t n{unit().positionInRecord - unit().furthestPositionInRecord}; - unit().positionInRecord = unit().furthestPositionInRecord; while (n-- > 0 && unit().Emit(" ", 1, 1, *this)) { } - unit().leftTabLimit = unit().furthestPositionInRecord; + unit().leftTabLimit = unit().positionInRecord; } else { unit().AdvanceRecord(*this); }