[Chapel Merge] Fix EOF handling for ASCII files

Branch: refs/heads/main
Revision: 0297d81
Author: mppf
Link: Fix EOF handling for ASCII files by jlbyrne-hpe · Pull Request #19191 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #19191 from jlbyrne-hpe/john.l.byrne/eof-fix

Fix EOF handling for ASCII files

[PR by @jlbyrne-hpe - thanks! Reviewed and tested by @mppf]

Chapel documents a requirement that UTF-8 should be set in LANG,
but if it is not set, there is a separate code path that handles
text files as ASCII and this mishandled EOF. This was expressed
by procs such as channel.readf/readln segfaulting or hanging.

Modified Files:
M runtime/src/qio/qio_formatted.c

Compare: https://github.com/chapel-lang/chapel/compare/97d6355e6f5d...0297d8174803