summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/irb/ext/save-history.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/irb/ext/save-history.rb b/lib/irb/ext/save-history.rb
index dfde9d6fae..57ba7c1c53 100644
--- a/lib/irb/ext/save-history.rb
+++ b/lib/irb/ext/save-history.rb
@@ -106,14 +106,7 @@ module IRB
end
open(history_file, 'w', 0600 ) do |f|
- hist = history.map { |l|
- split_lines = l.split("\n")
- if split_lines.size == 1
- l
- else
- split_lines.join("\\\n")
- end
- }
+ hist = history.map{ |l| l.split("\n").join("\\\n") }
f.puts(hist[-num..-1] || hist)
end
end