diff options
author | nagachika <nagachika@ruby-lang.org> | 2021-03-20 16:15:35 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2021-03-20 16:15:35 +0900 |
commit | ec779aa56f4d6df465e721818d73d0d48fdf03f2 (patch) | |
tree | b6b4db09f9f0dcec4ccf76c2489b3ff417cf0d7f /test | |
parent | 6e962f02b266c3a6c47e50cf2e9ab7b1db25e515 (diff) |
merge revision(s) f748b911c9157a0bb86f38280ddfba72a55049b6: [Backport #17729]
Fix infinite loop at illegal sequence [Bug #17729]
As mblen returns -1 on failure, skip the first byte and try the
succeeding bytes in that case.
Close https://github.com/ruby/ruby/pull/4281
---
eval_intern.h | 11 ++++++++++-
test/ruby/test_rubyoptions.rb | 5 +++++
2 files changed, 15 insertions(+), 1 deletion(-)
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 26e7f5dca3..2842b63804 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -1069,6 +1069,11 @@ class TestRubyOptions < Test::Unit::TestCase end end + def test_rubylib_invalid_encoding + env = {"RUBYLIB"=>"\xFF", "LOCALE"=>"en_US.UTF-8", "LC_ALL"=>"en_US.UTF-8"} + assert_ruby_status([env, "-e;"]) + end + def test_null_script skip "#{IO::NULL} is not a character device" unless File.chardev?(IO::NULL) assert_in_out_err([IO::NULL], success: true) |