File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,17 @@ def keymap
83
83
@key_actors [ @keymap_label ]
84
84
end
85
85
86
+ def inputrc_path
87
+ case ENV [ 'INPUTRC' ]
88
+ when nil , ''
89
+ DEFAULT_PATH
90
+ else
91
+ ENV [ 'INPUTRC' ]
92
+ end
93
+ end
94
+
86
95
def read ( file = nil )
87
- file ||= File . expand_path ( ENV [ 'INPUTRC' ] || DEFAULT_PATH )
96
+ file ||= File . expand_path ( inputrc_path )
88
97
begin
89
98
if file . respond_to? ( :readlines )
90
99
lines = file . readlines
Original file line number Diff line number Diff line change @@ -206,4 +206,13 @@ def test_history_size
206
206
history << "a\n "
207
207
assert_equal 1 , history . size
208
208
end
209
+
210
+ def test_empty_inputrc_env
211
+ inputrc_backup = ENV [ 'INPUTRC' ]
212
+ ENV [ 'INPUTRC' ] = ''
213
+ assert_nothing_raised do
214
+ @config . read
215
+ end
216
+ ENV [ 'INPUTRC' ] = inputrc_backup
217
+ end
209
218
end
You can’t perform that action at this time.
0 commit comments