diff --git a/flang/runtime/edit-input.cpp b/flang/runtime/edit-input.cpp --- a/flang/runtime/edit-input.cpp +++ b/flang/runtime/edit-input.cpp @@ -58,15 +58,12 @@ // Returns true if there's a '-' sign. static bool ScanNumericPrefix(IoStatementState &io, const DataEdit &edit, std::optional &next, std::optional &remaining) { - bool bzMode{(edit.modes.editingFlags & blankZero) != 0}; - next = io.PrepareInput(edit, remaining, !bzMode); + next = io.PrepareInput(edit, remaining); bool negative{false}; if (next) { negative = *next == '-'; if (negative || *next == '+') { - if (!bzMode) { - io.SkipSpaces(remaining); - } + io.SkipSpaces(remaining); next = io.NextInField(remaining, edit); } } diff --git a/flang/runtime/io-stmt.h b/flang/runtime/io-stmt.h --- a/flang/runtime/io-stmt.h +++ b/flang/runtime/io-stmt.h @@ -133,8 +133,8 @@ // For fixed-width fields, initialize the number of remaining characters. // Skip over leading blanks, then return the first non-blank character (if // any). - std::optional PrepareInput(const DataEdit &edit, - std::optional &remaining, bool skipSpaces = true) { + std::optional PrepareInput( + const DataEdit &edit, std::optional &remaining) { remaining.reset(); if (edit.descriptor == DataEdit::ListDirected) { std::size_t byteCount{0}; @@ -143,9 +143,7 @@ if (edit.width.value_or(0) > 0) { remaining = *edit.width; } - if (skipSpaces) { - SkipSpaces(remaining); - } + SkipSpaces(remaining); } return NextInField(remaining, edit); }