mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
51ee24e7f7
commit
46c6da9c37
2 changed files with 7 additions and 1 deletions
|
@ -158,7 +158,7 @@ class Reline::Config
|
|||
end
|
||||
|
||||
def read_lines(lines, file = nil)
|
||||
if lines.first.encoding != Reline.encoding_system_needs
|
||||
if not lines.empty? and lines.first.encoding != Reline.encoding_system_needs
|
||||
begin
|
||||
lines = lines.map do |l|
|
||||
l.encode(Reline.encoding_system_needs)
|
||||
|
|
|
@ -311,6 +311,12 @@ class Reline::Config::Test < Reline::TestCase
|
|||
# do nothing
|
||||
end
|
||||
|
||||
def test_empty_inputrc
|
||||
assert_nothing_raised do
|
||||
@config.read_lines([])
|
||||
end
|
||||
end
|
||||
|
||||
def test_xdg_config_home
|
||||
home_backup = ENV['HOME']
|
||||
xdg_config_home_backup = ENV['XDG_CONFIG_HOME']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue