When a unified diff report that both files have a blank line,
it shows this as a line containing just a space.
Sometimes that space can go missing (spaces at the end of a line
are like that).
So if we find a completely empty line, treat it like a line
containing just a space.
Resolves-github-issue: #12
Reported-by: luckydonald @ github.com
Signed-off-by: NeilBrown <neilb@suse.de>
cp++;
copyline(&r2, &cp, end);
bcnt--;
+ } else if (*cp == '\n') {
+ /* Empty line - treat like " \n" - a blank line in both */
+ char *cp2 = cp;
+ copyline(&r1, &cp, end);
+ copyline(&r2, &cp2, end);
+ acnt --; bcnt--;
} else {
fprintf(stderr, "%s: bad unified patch at line %d\n",
Cmd, lineno);