summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-11 07:09:19 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-11 07:09:19 +0000
commit31fd8aa6814e590d10c4e962068a70c9cf708ce3 (patch)
treec103e602415443302f8b983f9280da7f4d5165d1
parentb01f0cab31d34451d00f1ee1ecffb79a7e11851b (diff)
* lib/pathname.rb (realpath): check existence of the file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--lib/pathname.rb2
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 772776f184..2a5699496e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
-Sat Oct 11 15:41:06 2003 Tanaka Akira <akr@m17n.org>
+Sat Oct 11 16:08:41 2003 Tanaka Akira <akr@m17n.org>
+
+ * lib/pathname.rb (realpath): check existence of the file.
* lib/pathname.rb (realpath): re-implemented.
(realpath_root?, realpath_rec): removed
diff --git a/lib/pathname.rb b/lib/pathname.rb
index 7bd007a2c8..9ececcb074 100644
--- a/lib/pathname.rb
+++ b/lib/pathname.rb
@@ -123,7 +123,7 @@ class Pathname
resolved.unshift unresolved.pop
else
path = top + unresolved.join('/')
- if FileTest.symlink? path
+ if File.lstat(path).symlink?
link = File.readlink(path)
if %r{\A/} =~ link
top = '/'