Subject: bug#65984: closed (Re: PATCH] diff: fix regression affecting the counting of diff context lines)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 16 Sep 2023 02:45:02 +0000

Your bug report

#65984: [PATCH] diff: fix regression affecting the counting of diff context lines

which was filed against the diffutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
65984: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65984
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: PATCH] diff: fix regression affecting the counting of diff context lines
From: Paul Eggert <[email-masked]>
To: Gleb Fotengauer-Malinovskiy <[email-masked]>
Cc: [email-masked]
Date: Fri, 15 Sep 2023 19:44:36 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Thanks for the fix. I installed it on Savannah.

Subject: [PATCH] diff: fix regression affecting the counting of diff context lines
From: Gleb Fotengauer-Malinovskiy <[email-masked]>
To: [email-masked]
Cc: Gleb Fotengauer-Malinovskiy <[email-masked]>
Date: Thu, 14 Sep 2023 21:16:51 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

This regression was introduced on 2023-05-22 in commit
v3.10-9-gda1697dcb6 ("diff: C99 decl style in context.c") during a code
style change.

This regression was discovered using the GNU patch testsuite:
FAIL: preserve-c-function-names
FAIL: reject-format

 * src/context.c (minus_prefix_lines): Initialize with a reversed value.

Tiny-change: yes
---
 src/context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/context.c b/src/context.c
index 8ee49ae961..34f046384c 100644
--- a/src/context.c
+++ b/src/context.c
@@ -186,7 +186,7 @@ pr_context_hunk (struct change *hunk)
 
   /* Include a context's width before and after.  */
 
-  lin minus_prefix_lines = curr.file[0].prefix_lines;
+  lin minus_prefix_lines = - curr.file[0].prefix_lines;
   first0 = MAX (first0 - context, minus_prefix_lines);
   first1 = MAX (first1 - context, minus_prefix_lines);
   if (last0 < curr.file[0].valid_lines - context)
-- 
glebfm