Project

General

Profile

Actions

Bug #14638

closed

[win32] File.expand_path("~") treats a relative path with a drive letter as an absolute path

Added by nobu (Nobuyoshi Nakada) about 6 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:86356]

Description

ENV["HOME"]="c:t"
p File.expand_path("~")==Dir.pwd+"/t"

prints true since 1.9.3, but it should raise an exception

$ ./1.8.7/i386-mswin32_120/miniruby -v -e 'ENV["HOME"]="c:t"; p File.expand_path("~")'
ruby 1.8.7 (2014-01-28 patchlevel 376) [i386-mswin32_120]
-e:1:in `expand_path': non-absolute home (ArgumentError)
    from -e:1
Actions #1

Updated by nobu (Nobuyoshi Nakada) about 6 years ago

  • Status changed from Open to Closed

Updated by usa (Usaku NAKAMURA) over 5 years ago

  • Backport changed from 2.3: REQUIRED, 2.4: REQUIRED, 2.5: REQUIRED to 2.3: REQUIRED, 2.4: DONE, 2.5: REQUIRED

ruby_2_4 r63806 merged revision(s) 62952.

Updated by nagachika (Tomoyuki Chikanaga) over 5 years ago

  • Backport changed from 2.3: REQUIRED, 2.4: DONE, 2.5: REQUIRED to 2.3: REQUIRED, 2.4: DONE, 2.5: DONE

ruby_2_5 r64421 merged revision(s) 62952.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0