<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -572,16 +572,30 @@ class File &lt; IO
   # 
   #  File.join(&quot;usr&quot;, &quot;mail&quot;, &quot;gumby&quot;)   #=&gt; &quot;usr/mail/gumby&quot;
   def self.join(*args)
-    args.map! { |o|
-      o = o.to_str unless Array === o || String === o
-      o
-    } rescue raise TypeError
-
-    # let join/split deal with all the recursive array complexities
-    # one small hack is to replace URI header with \0 and swap back later
-    result = args.join(SEPARATOR).gsub(/\:\//, &quot;\0&quot;).split(/#{SEPARATOR}+/o)
-    result &lt;&lt; '' if args.empty? || args.last.empty? || args.last[-1] == SEPARATOR[0]
-    result.join(SEPARATOR).gsub(/\0/, ':/')
+    return '' if args.empty?
+
+    ret = ''
+    args.each_with_index do |el, i|
+      value = nil
+      recursion = Thread.detect_recursion(el) do
+        if el.kind_of? Array
+          value = join(*el)
+        else
+          value = el.to_str rescue raise(TypeError)
+        end
+      end
+      raise ArgumentError, &quot;recursive array&quot; if recursion
+
+      if i &gt; 0
+        if value =~ /^#{SEPARATOR}/
+          ret.gsub!(/#{SEPARATOR}+$/, '')
+        elsif not ret =~ /#{SEPARATOR}$/
+          ret &lt;&lt; SEPARATOR
+        end
+      end
+      ret &lt;&lt; value
+    end
+    ret
   end
 
   ##</diff>
      <filename>kernel/common/file.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>spec/tags/frozen/core/file/join_tags.txt</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>8286cacbcd0221903f537fa06d8baf80598bf3ee</id>
    </parent>
  </parents>
  <author>
    <name>Cezar Sa Espinola</name>
    <login>cezarsa</login>
    <email>cezarsa@gmail.com</email>
  </author>
  <url>http://github.com/evanphx/rubinius/commit/a400264b8efa3074ee6e0441231a529f5cadd215</url>
  <id>a400264b8efa3074ee6e0441231a529f5cadd215</id>
  <committed-date>2009-07-02T14:59:43-07:00</committed-date>
  <authored-date>2009-07-02T14:28:08-07:00</authored-date>
  <message>Fixing File.join, all specs now passing.</message>
  <tree>899d25f990a12877e0cb4fff5a57459c7198116c</tree>
  <committer>
    <name>Cezar Sa Espinola</name>
    <login>cezarsa</login>
    <email>cezarsa@gmail.com</email>
  </committer>
</commit>
