Index: pathname.rb
===================================================================
--- pathname.rb (revision 4471)
+++ pathname.rb (working copy)
@@ -285,6 +285,8 @@
def prepend_prefix(prefix, relpath)
if relpath.empty?
File.dirname(prefix)
+ elsif prefix =~ /^[a-zA-Z]:$/
+ File.join(prefix,relpath)
elsif /#{SEPARATOR_PAT}/ =~ prefix
prefix = File.dirname(prefix)
prefix = File.join(prefix, "") if File.basename(prefix + 'a') != 'a'
@@ -408,6 +410,8 @@
next
elsif n == '..'
resolved.pop
+ elsif n =~ /^[a-zA-Z]:$/
+ resolved << n
else
path = prepend_prefix(prefix, File.join(*(resolved + [n])))
if h.include? path
@@ -446,7 +450,9 @@
def realpath
path = @path
prefix, names = split_names(path)
- if prefix == ''
+ if prefix == '' && names[0] =~ /^[a-zA-Z]:$/
+ prefix = names.shift
+ elsif prefix == ''
prefix, names2 = split_names(Dir.pwd)
names = names2 + names
end