diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-11 07:12:09 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-11 07:12:09 +0000 |
commit | db932bd8882fb9261631b19d0e35f2926234ba95 (patch) | |
tree | 951c483a1d5bf7fcce3afefb149dade56f7c12d8 /lib/pathname.rb | |
parent | b44612e68801a79fb7c1219b00f228db3d1e6ff7 (diff) | |
download | ruby-db932bd8882fb9261631b19d0e35f2926234ba95.tar.gz ruby-db932bd8882fb9261631b19d0e35f2926234ba95.tar.xz ruby-db932bd8882fb9261631b19d0e35f2926234ba95.zip |
fix previous change.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/pathname.rb')
-rw-r--r-- | lib/pathname.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pathname.rb b/lib/pathname.rb index 9ececcb07..8df49159c 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -111,6 +111,8 @@ class Pathname # it may return relative pathname. # Otherwise it returns absolute pathname. def realpath(force_absolute=true) + File.stat(@path) + top = %r{\A/} =~ @path ? '/' : '' unresolved = @path.scan(%r{[^/]+}) resolved = [] @@ -123,7 +125,7 @@ class Pathname resolved.unshift unresolved.pop else path = top + unresolved.join('/') - if File.lstat(path).symlink? + if FileTest.symlink? path link = File.readlink(path) if %r{\A/} =~ link top = '/' |