Project

General

Profile

Feature #5337 ยป patch.diff

Glass_saga (Masaki Matsushita), 09/19/2011 06:01 PM

View differences:

lib/fileutils.rb
823 823
  #
824 824
  def compare_stream(a, b)
825 825
    bsize = fu_stream_blksize(a, b)
826
    sa = sb = nil
827
    while sa == sb
828
      sa = a.read(bsize)
829
      sb = b.read(bsize)
830
      unless sa and sb
831
        if sa.nil? and sb.nil?
832
          return true
833
        end
834
      end
835
    end
826
    sa = ""
827
    sb = ""
828
    begin
829
      a.read(bsize, sa)
830
      b.read(bsize, sb)
831
      return true if sa.empty? && sb.empty?
832
    end while sa == sb
836 833
    false
837 834
  end
838 835
  module_function :compare_stream