Index: flang/runtime/edit-input.cpp =================================================================== --- flang/runtime/edit-input.cpp +++ 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); } } @@ -189,7 +186,6 @@ first == 'D' || first == 'Q') { Put('.'); // input field is normalized to a fraction auto start{got}; - bool anyDigit{false}; for (; next; next = io.NextInField(remaining, edit)) { char32_t ch{*next}; if (ch == ' ' || ch == '\t') { @@ -200,10 +196,8 @@ } } if (ch == '0' && got == start && !decimalPoint) { - anyDigit = true; // omit leading zeroes before the decimal } else if (ch >= '0' && ch <= '9') { - anyDigit = true; Put(ch); } else if (ch == decimal && !decimalPoint) { // the decimal point is *not* copied to the buffer @@ -213,11 +207,10 @@ } } if (got == start) { - if (anyDigit) { - Put('0'); // emit at least one digit - } else { - return 0; // no digits, invalid input - } + // Nothing but zeroes and maybe a decimal point. F'2018 requires + // at least one digit, but F'77 did not, and a bare "." shows up in + // the FCVS suite. + Put('0'); // emit at least one digit } if (next && (*next == 'e' || *next == 'E' || *next == 'd' || *next == 'D' ||