Actions
Bug #14640
closed[win32] File.realpath treats a relative path with a drive letter as an absolute path.
Bug #14640:
[win32] File.realpath treats a relative path with a drive letter as an absolute path.
Actions
Added by nobu (Nobuyoshi Nakada) over 8 years ago. Updated 14 days ago.
Applied in changeset git|a22017a42a13945ce3c9129135ae760c988a1ba9.
[Bug #14640] Fix File.realpath with a drive-relative path
A drive letter without a following separator ("c:t") means a path relative to the current directory of that drive, as File.absolute_path interprets it, not the absolute path "c:/t". A drive-relative basedir is read the same way, "~" stays literal since realpath does not expand home directories, and US-ASCII or ASCII-8BIT input is expanded in the filesystem encoding so that a non-ASCII current directory does not come back as "?".
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com