We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e4d398 commit b60b3b7Copy full SHA for b60b3b7
lib/reline/config.rb
@@ -158,7 +158,7 @@ def reset_default_key_bindings
158
end
159
160
def read_lines(lines, file = nil)
161
- if lines.first.encoding != Reline.encoding_system_needs
+ if not lines.empty? and lines.first.encoding != Reline.encoding_system_needs
162
begin
163
lines = lines.map do |l|
164
l.encode(Reline.encoding_system_needs)
test/reline/test_config.rb
@@ -311,6 +311,12 @@ def test_inputrc_with_eucjp
311
# do nothing
312
313
314
+ def test_empty_inputrc
315
+ assert_nothing_raised do
316
+ @config.read_lines([])
317
+ end
318
319
+
320
def test_xdg_config_home
321
home_backup = ENV['HOME']
322
xdg_config_home_backup = ENV['XDG_CONFIG_HOME']
0 commit comments