check_line() includes invisible bits because they could in some sense
be part of 'this' line. It ignore hunk headers, but it really should stop
at them, because nothing before could be related to this line.
This fixes a problem where 'N' and 'P' would find hunk headers
which isn't really helpful.
Signed-off-by: NeilBrown <neilb@suse.de>
if (mode & (BEFORE|AFTER))
rv |= CHANGES;
} else if (m[pos.p.m].type == Extraneous) {
- /* hunk headers don't count as wiggles */
- if (fb.list[m[pos.p.m].b].start[0] != '\0')
+ if (fb.list[m[pos.p.m].b].start[0] == '\0')
+ /* hunk headers don't count as wiggles
+ * and nothing before a hunk header
+ * can possibly be part of this 'line' */
+ break;
+ else
rv |= WIGGLED;
} else if (m[pos.p.m].type == Unmatched)
unmatched = 1;