diff options
author | NARUSE, Yui <naruse@airemix.jp> | 2021-04-02 12:27:26 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2021-04-02 12:27:26 +0900 |
commit | 1a47de64f44da6d4339ba8b2c5220eeaba82954c (patch) | |
tree | 9a6edc691c4b97cedcc9ad2231b02d70098591d8 /test | |
parent | d1cec0bca588266b9af1d55e592016c45ee68fbb (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 b7831948f0..0d0f4b4d7e 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -1075,6 +1075,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) |