mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
b01f0cab31
commit
31fd8aa681
2 changed files with 4 additions and 2 deletions
|
@ -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.
|
* lib/pathname.rb (realpath): re-implemented.
|
||||||
(realpath_root?, realpath_rec): removed
|
(realpath_root?, realpath_rec): removed
|
||||||
|
|
|
@ -123,7 +123,7 @@ class Pathname
|
||||||
resolved.unshift unresolved.pop
|
resolved.unshift unresolved.pop
|
||||||
else
|
else
|
||||||
path = top + unresolved.join('/')
|
path = top + unresolved.join('/')
|
||||||
if FileTest.symlink? path
|
if File.lstat(path).symlink?
|
||||||
link = File.readlink(path)
|
link = File.readlink(path)
|
||||||
if %r{\A/} =~ link
|
if %r{\A/} =~ link
|
||||||
top = '/'
|
top = '/'
|
||||||
|
|
Loading…
Reference in a new issue