summaryrefslogtreecommitdiff
path: root/lib/irb/ext/save-history.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/irb/ext/save-history.rb')
-rw-r--r--lib/irb/ext/save-history.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/irb/ext/save-history.rb b/lib/irb/ext/save-history.rb
index ad954c3558..2135184dba 100644
--- a/lib/irb/ext/save-history.rb
+++ b/lib/irb/ext/save-history.rb
@@ -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