diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-11-07 02:08:04 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-11-07 02:08:04 +0000 |
commit | dc592364e62b75e778834dad8eaf1447f24ec573 (patch) | |
tree | a644aeccd0d12dccbf48b29d50780afd22341432 /lib | |
parent | e7688cebe5bea320b153436850c92ab63de9983a (diff) | |
download | ruby-dc592364e62b75e778834dad8eaf1447f24ec573.tar.gz |
* lib/pathname.rb (Pathname#+): return the argument if self is `.'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pathname.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/pathname.rb b/lib/pathname.rb index b4462bfeaf..c433f5dffc 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -213,10 +213,12 @@ class Pathname # Pathname#+ return new pathname which is concatenated with self and # an argument. - # If the argument is absolute pathname, it is just returned. + # If self is the current working directory `.' or + # the argument is absolute pathname, + # the argument is just returned. def +(other) other = Pathname.new(other) unless Pathname === other - if other.absolute? + if @path == '.' || other.absolute? other elsif %r{/\z} =~ @path Pathname.new(@path + other.to_s) |