commit - 467a993dc1da672ac3093104cbeae0dc22f978f9
commit + 41ff30f35eb8d2ee0688753ce9be23cb2727b92a
blob - 82a44b8c680bcf2c6693dcaa405869824ac95696
blob + e1c91e207ea111f2b335b80d5614b68e6413b480
--- lib/diff_main.c
+++ lib/diff_main.c
unsigned int l_len = state->left.atoms.len;
struct diff_atom *r = state->right.atoms.head;
unsigned int r_len = state->right.atoms.len;
- unsigned int equal_atoms = 0;
+ unsigned int equal_atoms_start = 0;
- while (equal_atoms < l_len
- && equal_atoms < r_len) {
+ while (equal_atoms_start < l_len
+ && equal_atoms_start < r_len) {
int err;
bool same;
- err = diff_atom_same(&same, &l[equal_atoms],
- &r[equal_atoms]);
+ err = diff_atom_same(&same, &l[equal_atoms_start],
+ &r[equal_atoms_start]);
if (err)
return err;
if (!same)
break;
- equal_atoms++;
+ equal_atoms_start++;
}
- if (equal_atoms) {
+ if (equal_atoms_start) {
if (!diff_state_add_chunk(state, true,
&l[0],
- equal_atoms,
+ equal_atoms_start,
&r[0],
- equal_atoms))
+ equal_atoms_start))
return ENOMEM;
}
/* Add a "minus" chunk with all lines from the left. */
- if (equal_atoms < l_len) {
+ if (equal_atoms_start < l_len) {
if (!diff_state_add_chunk(state, true,
- &l[equal_atoms],
- l_len - equal_atoms,
+ &l[equal_atoms_start],
+ l_len - equal_atoms_start,
NULL, 0))
return ENOMEM;
}
/* Add a "plus" chunk with all lines from the right. */
- if (equal_atoms < r_len) {
+ if (equal_atoms_start < r_len) {
if (!diff_state_add_chunk(state, true,
NULL, 0,
- &r[equal_atoms],
- r_len - equal_atoms))
+ &r[equal_atoms_start],
+ r_len - equal_atoms_start))
return ENOMEM;
}
return DIFF_RC_OK;