summaryrefslogtreecommitdiff
path: root/ext/pathname
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-02 02:51:20 (GMT)
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-02 02:51:20 (GMT)
commit60d4fc9f68c16099a9d9574ebea599b084a4a237 (patch)
tree01276763f0b99390f63d4a267114b6ad4e56a428 /ext/pathname
parent1170b057e02cefd34b4ff88ee01369c91b16ae2d (diff)
Fix error with empty args.
* ext/pathname/lib/pathname.rb (Pathname#join): Fix error with empty args. Reported by ko1 via IRC. * test/pathname/test_pathname.rb (TestPathname#test_join): Add the test for above case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/pathname')
-rw-r--r--ext/pathname/lib/pathname.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index bbcb5e4..aa94647 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -384,6 +384,7 @@ class Pathname
# #=> true
#
def join(*args)
+ return self if args.empty?
result = args.pop
result = Pathname.new(result) unless Pathname === result
return result if result.absolute?