Show More
@@ -184,7 +184,7 b' static int longest_match(struct bdiff_li' | |||||
184 | mj = j; |
|
184 | mj = j; | |
185 | mk = k; |
|
185 | mk = k; | |
186 | } else if (k == mk) { |
|
186 | } else if (k == mk) { | |
187 | if (i > mi && i <= half) { |
|
187 | if (i > mi && i <= half && j > b1) { | |
188 | /* same match but closer to half */ |
|
188 | /* same match but closer to half */ | |
189 | mi = i; |
|
189 | mi = i; | |
190 | mj = j; |
|
190 | mj = j; |
@@ -88,7 +88,7 b' print("Diff 1 to 3 lines - preference fo' | |||||
88 | showdiff('a\n', 'a\n' * 3) |
|
88 | showdiff('a\n', 'a\n' * 3) | |
89 | print("Diff 1 to 5 lines - preference for appending:") |
|
89 | print("Diff 1 to 5 lines - preference for appending:") | |
90 | showdiff('a\n', 'a\n' * 5) |
|
90 | showdiff('a\n', 'a\n' * 5) | |
91 |
print("Diff 3 to 1 lines - preference for |
|
91 | print("Diff 3 to 1 lines - preference for removing trailing lines:") | |
92 | showdiff('a\n' * 3, 'a\n') |
|
92 | showdiff('a\n' * 3, 'a\n') | |
93 |
print("Diff 5 to 1 lines - preference for |
|
93 | print("Diff 5 to 1 lines - preference for removing trailing lines:") | |
94 | showdiff('a\n' * 5, 'a\n') |
|
94 | showdiff('a\n' * 5, 'a\n') |
@@ -68,17 +68,15 b' showdiff(' | |||||
68 | 'a\na\na\na\na\n'): |
|
68 | 'a\na\na\na\na\n'): | |
69 | 'a\n' |
|
69 | 'a\n' | |
70 | 2 2 '' -> 'a\na\na\na\n' |
|
70 | 2 2 '' -> 'a\na\na\na\n' | |
71 |
Diff 3 to 1 lines - preference for |
|
71 | Diff 3 to 1 lines - preference for removing trailing lines: | |
72 | showdiff( |
|
72 | showdiff( | |
73 | 'a\na\na\n', |
|
73 | 'a\na\na\n', | |
74 | 'a\n'): |
|
74 | 'a\n'): | |
75 | 0 2 'a\n' -> '' |
|
|||
76 | 'a\n' |
|
75 | 'a\n' | |
77 |
|
|
76 | 2 6 'a\na\n' -> '' | |
78 |
Diff 5 to 1 lines - preference for |
|
77 | Diff 5 to 1 lines - preference for removing trailing lines: | |
79 | showdiff( |
|
78 | showdiff( | |
80 | 'a\na\na\na\na\n', |
|
79 | 'a\na\na\na\na\n', | |
81 | 'a\n'): |
|
80 | 'a\n'): | |
82 | 0 4 'a\na\n' -> '' |
|
|||
83 | 'a\n' |
|
81 | 'a\n' | |
84 |
|
|
82 | 2 10 'a\na\na\na\n' -> '' |
General Comments 0
You need to be logged in to leave comments.
Login now