diff --git a/flang/runtime/namelist.cpp b/flang/runtime/namelist.cpp --- a/flang/runtime/namelist.cpp +++ b/flang/runtime/namelist.cpp @@ -383,7 +383,11 @@ next = io.GetNextNonBlank(byteCount); } } - if (!next || *next != '&') { + if (!next) { + handler.SignalEnd(); + return false; + } + if (*next != '&') { handler.SignalError( "NAMELIST input group does not begin with '&' (at '%lc')", *next); return false;