From 60d4fc9f68c16099a9d9574ebea599b084a4a237 Mon Sep 17 00:00:00 2001 From: kazu Date: Wed, 2 Apr 2014 02:51:20 +0000 Subject: 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 --- ext/pathname/lib/pathname.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'ext/pathname/lib') diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb index bbcb5e4e2a..aa9464799d 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? -- cgit v1.2.3