This project is closed and read-only.
Actions
Backport #3630
closedFile.expand_path doesn't expand content of HOME env. variable
Backport #3630:
File.expand_path doesn't expand content of HOME env. variable
Status:
Closed
Assignee:
Description
=begin
Dir.chdir 'C:/temp' do
p File.expand_path("a")
ENV["HOME"] = './abc/../xxx'
p File.expand_path("~/a")
ENV["HOME"] = '/xxx'/a")
p File.expand_path("
end
Prints:
"C:/temp/a"
"./abc/../xxx/a"
"~/xxx/a"
I'd expect it to print:
"C:/temp/a"
"C:/temp/xxx/a"
"C:/temp/~/xxx/a"
The content of HOME variable should be subject to expansion. If it starts with ~/ the tilde should be treated like a regular directory name to avoid recursion.
=end
Actions