#! /bin/sh /usr/share/dpatch/dpatch-run
## 01_debian-patch.dpatch by  <takaki@asis.media-as.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: New patch generated from libalgorithm-diff-ruby 0.4-8 diff.gz

@DPATCH@

--- libalgorithm-diff-ruby-0.4.orig/lib/algorithm/diff.rb
+++ libalgorithm-diff-ruby-0.4/lib/algorithm/diff.rb
@@ -195,7 +195,7 @@
 	if kindofstring
 	  newary << elements
 	else
-	  newary.push *elements
+	  newary.push(*elements)
 	end
 	bi += elements.length
       else
--- libalgorithm-diff-ruby-0.4.orig/samples/unixdiff.rb
+++ libalgorithm-diff-ruby-0.4/samples/unixdiff.rb
@@ -20,10 +20,15 @@
   end
 end
 
-class Diff
+class Diff2
+  def initialize(a,b)
+    @diffs = Diff::diff(a,b)
+  end
+
   def to_diff(io = $defout)
     offset = 0
     return if @diffs.empty?
+    p @diffs
     #@diffs.each { |b|
     first = @diffs[0][1]
       length = @diffs.length
@@ -31,9 +36,9 @@
       addcount = 0
       remcount = 0
       @diffs.each { |l| 
-        if l[0] == "+"
+        if l[0] == :+
           addcount += 1
-        elsif l[0] == "-"
+        elsif l[0] == :-
           remcount += 1
         end
       }
@@ -44,12 +49,12 @@
       else
         puts "#{diffrange(first+1, first+remcount)}c#{diffrange(first+offset+1, first+offset+addcount)}"
       end
-      lastdel = (@diffs[0][0] == "-")
+      lastdel = (@diffs[0][0] == :-)
       @diffs.each { |l|
-        if l[0] == "-"
+        if l[0] == :- 
           offset -= 1
           print "< "
-        elsif l[0] == "+"
+        elsif l[0] == :+
           offset += 1
 	  if lastdel
 	    lastdel = false
@@ -71,7 +76,7 @@
   ary1 = loadfile file1
   ary2 = loadfile file2
 
-  diff = Diff.new(ary1, ary2)
+  diff = Diff2.new(ary1, ary2)
   diff.to_diff
 
 end
