mercurial/mdiff.py
changeset 361 88268aa2b8d2
parent 330 27d08c0c2a7e
child 396 8f8bb77d560e
--- a/mercurial/mdiff.py	Wed Jun 15 13:04:05 2005 -0800
+++ b/mercurial/mdiff.py	Wed Jun 15 15:49:20 2005 -0800
@@ -58,14 +58,14 @@
             yield (am, bm, la - am) # return a match
 
         # skip mismatched lines from b
-        while lb < lenb and b[lb] < a[la]:
+        while la < lena and lb < lenb and b[lb] < a[la]:
             lb += 1
 
         if lb >= lenb:
             break
         
         # skip mismatched lines from a
-        while la < lena and b[lb] > a[la]:
+        while la < lena and lb < lenb and b[lb] > a[la]:
             la += 1
 
         if la >= lena: