diff options
author | Tony Cook <tony@develop-help.com> | 2022-08-16 15:52:04 +1000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2022-08-31 10:51:09 +1000 |
commit | 80c1f1e45e8ef8c27d170fae7ade41971fe20218 (patch) | |
tree | 390f74e13dccc68dadda91a6ddb4fb059010212b /t/lib | |
parent | 02cf5fb76fa9ca5db8d1b04f9087dd6d0f81848e (diff) | |
download | perl-80c1f1e45e8ef8c27d170fae7ade41971fe20218.tar.gz |
only clear the stream error state in readline() for glob()
This would previously clear the stream error state in any case
where sv_gets() failed and the error state was set.
This included normal files, which meant that the fact that an error
occurred was no longer reflected in the stream state.
For reads from ARGV this was a no-op, since nextargv() re-opens the
input stream by calling do_open6() which closes the old input stream
silently.
For glob() (and really only for miniperl, since File::Glob is used for
a full perl) leaving the stream in an error state could be confusing
for the error reporting done when do_close() fails, since it would
fail if the stream has an error state, but we report it as the
underlying pclose() failing due to the child process failing in some
way.
Since this now leaves the error state on the stream, the close()
calls in the test updated by this commit would fail, changing its
output. Since the result of those closes didn't seem related
to the purpose of the test, I changed it not throw an error on
either close() failing.
Diffstat (limited to 't/lib')
-rw-r--r-- | t/lib/warnings/pp_hot | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/lib/warnings/pp_hot b/t/lib/warnings/pp_hot index e660528b52..0e337431dd 100644 --- a/t/lib/warnings/pp_hot +++ b/t/lib/warnings/pp_hot @@ -237,8 +237,8 @@ $a = <FOO> ; use warnings 'io' ; $a = <FOO> ; $a = <FH> ; -close (FH) or die $! ; -close (FOO) or die $! ; +close (FH); +close (FOO); unlink $file ; EXPECT Filehandle FH opened only for output at - line 5. |