GNU bug report logs - #65984
[PATCH] diff: fix regression affecting the counting of diff context lines

Previous Next

Package: diffutils;

Reported by: Gleb Fotengauer-Malinovskiy <glebfm <at> altlinux.org>

Date: Thu, 14 Sep 2023 22:59:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#65984: closed ([PATCH] diff: fix regression affecting the
 counting of diff context lines)
Date: Sat, 16 Sep 2023 02:45:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 15 Sep 2023 19:44:36 -0700
with message-id <b8294512-9b70-59ad-17a3-24299bd6644b <at> cs.ucla.edu>
and subject line Re: PATCH] diff: fix regression affecting the counting of diff context lines
has caused the debbugs.gnu.org bug report #65984,
regarding [PATCH] diff: fix regression affecting the counting of diff context lines
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
65984: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65984
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Gleb Fotengauer-Malinovskiy <glebfm <at> altlinux.org>
To: bug-diffutils <at> gnu.org
Cc: Gleb Fotengauer-Malinovskiy <glebfm <at> altlinux.org>
Subject: [PATCH] diff: fix regression affecting the counting of diff context
 lines
Date: Thu, 14 Sep 2023 21:16:51 +0000
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



[Message part 3 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Gleb Fotengauer-Malinovskiy <glebfm <at> altlinux.org>
Cc: 65984-done <at> debbugs.gnu.org
Subject: Re: PATCH] diff: fix regression affecting the counting of diff
 context lines
Date: Fri, 15 Sep 2023 19:44:36 -0700
Thanks for the fix. I installed it on Savannah.


This bug report was last modified 1 year and 247 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.