Merge pull request #7810 from jepler/read-error-getenv

getenv: treat a read error like eof
This commit is contained in:
Dan Halbert 2023-03-29 13:04:43 -04:00 committed by GitHub
commit 6a4830b0cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,7 +72,7 @@ STATIC void close_file(file_arg *active_file) {
// nothing
}
STATIC bool is_eof(file_arg *active_file) {
return f_eof(active_file);
return f_eof(active_file) || f_error(active_file);
}
// Return 0 if there is no next character (EOF).