1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/irb] Fix the error when LC_MESSAGES config value is nil

https://github.com/ruby/irb/commit/6bbde84369
This commit is contained in:
Nobuyoshi Nakada 2022-09-14 11:05:43 +09:00 committed by git
parent e2b47b832f
commit f863bc505c

View file

@ -113,7 +113,7 @@ module IRB
append_history = true
end
open(history_file, "#{append_history ? 'a' : 'w'}:#{IRB.conf[:LC_MESSAGES].encoding}", 0600) do |f|
File.open(history_file, (append_history ? 'a' : 'w'), 0o600, encoding: IRB.conf[:LC_MESSAGES]&.encoding) do |f|
hist = history.map{ |l| l.split("\n").join("\\\n") }
unless append_history
begin