Project

General

Profile

Actions

Backport #3629

closed

expand_path doesn't expand "~a"

Added by tmat (Tomas Matousek) over 13 years ago. Updated over 12 years ago.

Status:
Closed
[ruby-core:31536]

Description

=begin
ENV["HOME"] = 'C:/xxx'
Dir.chdir 'C:/temp' do
p File.expand_path("a")
p File.expand_path("~/a")
p File.expand_path("~a")
end

Prints:

"C:/temp/a"
"C:/xxx/a"
"~a"

I'd expect it to print:
"C:/temp/a"
"C:/xxx/a"
"c:/temp/~a"

"~a" should be considered a regular file name and as such should be prefixed with the current directory path like any other file name.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0