summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorhogelog <konbu.komuro@gmail.com>2023-12-02 03:03:58 +0900
committergit <svn-admin@ruby-lang.org>2023-12-01 18:04:03 +0000
commitef466ac931dcb37f98fc89eba526c2593e1cddb0 (patch)
tree225edb11f0bf01cf1569ce2f365fe57bac901177 /lib
parent73440e1ef21e1dd7ca590e402d37b835b9b1f0bb (diff)
[ruby/irb] Scrub past history input before split
(https://github.com/ruby/irb/pull/795) * Scrub past history input before split * Don't rewrite ENV["LANG"] https://github.com/ruby/irb/commit/0f344f66d9
Diffstat (limited to 'lib')
-rw-r--r--lib/irb/history.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/irb/history.rb b/lib/irb/history.rb
index 84d69e19cd..06088adb0d 100644
--- a/lib/irb/history.rb
+++ b/lib/irb/history.rb
@@ -60,7 +60,7 @@ module IRB
end
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") }
+ hist = history.map{ |l| l.scrub.split("\n").join("\\\n") }
unless append_history
begin
hist = hist.last(num) if hist.size > num and num > 0