From: Aaro Koskinen Date: Thu, 30 Jul 2015 20:13:25 +0000 (+0300) Subject: diff: fix -B with single line changes X-Git-Tag: 1_24_0~78 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a47fccaa63449182a5d0c11cf03139a072f8c19c;p=oweals%2Fbusybox.git diff: fix -B with single line changes Fix -B with single line changes. They were always ignored regardless if they were blank or not. Signed-off-by: Aaro Koskinen Signed-off-by: Denys Vlasenko --- diff --git a/editors/diff.c b/editors/diff.c index cf14b1d03..e0adcee59 100644 --- a/editors/diff.c +++ b/editors/diff.c @@ -658,8 +658,8 @@ static bool diff(FILE* fp[2], char *file[2]) } for (j = 0; j < 2; j++) - for (k = v[j].a; k < v[j].b; k++) - nonempty |= (ix[j][k+1] - ix[j][k] != 1); + for (k = v[j].a; k <= v[j].b; k++) + nonempty |= (ix[j][k] - ix[j][k - 1] != 1); vec = xrealloc_vector(vec, 6, ++idx); memcpy(vec[idx], v, sizeof(v));