diff options
| author | Matt Valentine-House <matt@eightbitraptor.com> | 2023-12-18 16:56:01 +0000 |
|---|---|---|
| committer | Matt Valentine-House <matt@eightbitraptor.com> | 2023-12-18 19:44:44 +0000 |
| commit | 893fe30ef2b30525d932d6b1256f717cc60b3311 (patch) | |
| tree | f01f11c68db774a862998086c9cbfa2b47fc87ca /test/ruby | |
| parent | 4b125b70d8584c6ebf2971d588c5c8a106fffc05 (diff) | |
[PRISM] Fix crash when --parser=prism called with stdin
[Bug #20071]
Currently Ruby crashes when the --parser=prism flag is used either with
no input, or with input that is being redirected from stdin. So all of
the following will crash
ruby --parser=prism
ruby --parser=prism < test_code.rb
cat test_code.rb | ruby --parser=prism
This commit checks whether the input is assumed to be from stdin, and
then processes that as a file.
This will fix the second and third case above, but will cause a slight
behavioural changes for the first case - Ruby will treat stdin as an
empty file in this case and exit, rather than waiting for data to be
piped into stdin.
Diffstat (limited to 'test/ruby')
0 files changed, 0 insertions, 0 deletions
