# File lib/pathname2.rb, line 610
   def relative_path_from(base)
      base = self.class.new(base) unless base.kind_of?(Pathname)

      if self.absolute? != base.absolute?
         raise ArgumentError, "relative path between absolute and relative path"
      end

      return self.class.new(".") if self == base
      return self if base == "."
      
      # Because of the way the Windows version handles Pathname#clean, we need
      # a little extra help here.
      if @win
         if root != base.root
            msg = 'cannot determine relative paths from different root paths'
            raise ArgumentError, msg
         end
         if base == '..' && (self != '..' || self != '.')
            raise ArgumentError, "base directory may not contain '..'"
         end
      end

      dest_arr = self.clean.to_a
      base_arr = base.clean.to_a
      dest_arr.delete('.')
      base_arr.delete('.')

      diff_arr = dest_arr - base_arr

      while !base_arr.empty? && !dest_arr.empty? && base_arr[0] == dest_arr[0]
         base_arr.shift
         dest_arr.shift
      end

      if base_arr.include?("..")
         raise ArgumentError, "base directory may not contain '..'"
      end

      base_arr.fill("..")
      rel_path = base_arr + dest_arr

      if rel_path.empty?
         self.class.new(".")
      else
         self.class.new(rel_path.join(@sep))
      end
   end