From d3d249b9048b338535ae033acb3606abf174b2da Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 1 Jul 2025 17:24:02 +0900 Subject: [PATCH] [ruby/io-console] Fix removing unexpected control chars `cc` is created as `"\C-x"`, it is a String since ruby 1.9. https://github.com/ruby/io-console/commit/65c9266feb --- test/io/console/test_io_console.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index 59fe01879b..c3f9c91c7d 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -373,10 +373,10 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do w.flush result = EnvUtil.timeout(3) {r.gets} if result - case cc - when 0..31 + case cc.chr + when "\C-A".."\C-_" cc = "^" + (cc.ord | 0x40).chr - when 127 + when "\C-?" cc = "^?" end result.sub!(cc, "")