ruby-changes:63950
From: Robert <ko1@a...>
Date: Sat, 5 Dec 2020 03:15:50 +0900 (JST)
Subject: [ruby-changes:63950] f4386413f1 (master): Cope with frozen-string-literal
https://git.ruby-lang.org/ruby.git/commit/?id=f4386413f1 From f4386413f16f9e492a74f6b65e981e20e22c4849 Mon Sep 17 00:00:00 2001 From: Robert Schulze <robert@d...> Date: Wed, 5 Feb 2020 10:59:13 +0100 Subject: Cope with frozen-string-literal When running irb 1.2.1 (2019-12-24) with frozen-string-literal enabled, it crashes in reline with `can't modify frozen String (FrozenError)` Steps to reproduce: `RUBYOPT="--enable-frozen-string-literal" irb` diff --git a/lib/reline/ansi.rb b/lib/reline/ansi.rb index 0b1a7e1..0fddbcc 100644 --- a/lib/reline/ansi.rb +++ b/lib/reline/ansi.rb @@ -172,7 +172,7 @@ class Reline::ANSI https://github.com/ruby/ruby/blob/trunk/lib/reline/ansi.rb#L172 def self.cursor_pos begin - res = '' + res = String.new m = nil @@input.raw do |stdin| @@output << "\e[6n" -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/