aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reline
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2020-04-24 03:10:41 +0900
committeraycabta <aycabta@gmail.com>2020-04-24 16:46:36 +0900
commit9fb20711fd4c4c452b1b7391a8ca86a4d82f6b90 (patch)
tree2f96c3fc017daaea9cd0bdcba29bc25d5dbcfe9c /lib/reline
parent81b0b7919718bf7f8a6bd9590651b62279977327 (diff)
downloadruby-9fb20711fd4c4c452b1b7391a8ca86a4d82f6b90.tar.gz
[ruby/reline] Treat home dir correctly
https://github.com/ruby/reline/commit/9b1327d2f4
Diffstat (limited to 'lib/reline')
-rw-r--r--lib/reline/config.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/reline/config.rb b/lib/reline/config.rb
index 0e5488eefb..b299bcc9cd 100644
--- a/lib/reline/config.rb
+++ b/lib/reline/config.rb
@@ -91,8 +91,8 @@ class Reline::Config
# In the XDG Specification, if ~/.config/readline/inputrc exists, then
# ~/.inputrc should not be read, but for compatibility with GNU Readline,
# if ~/.inputrc exists, then it is given priority.
- path = File.expand_path('~/.inputrc')
- return path if File.exist?(path)
+ home_rc_path = File.expand_path('~/.inputrc')
+ return home_rc_path if File.exist?(home_rc_path)
case ENV['XDG_CONFIG_HOME']
when nil, ''
@@ -102,6 +102,8 @@ class Reline::Config
path = File.expand_path("#{ENV['XDG_CONFIG_HOME']}/readline/inputrc")
return path if File.exist?(path)
end
+
+ return home_rc_path
end
def read(file = nil)