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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 65984 in the body.
You can then email your comments to 65984 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-diffutils <at> gnu.org:
bug#65984; Package diffutils. (Thu, 14 Sep 2023 22:59:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gleb Fotengauer-Malinovskiy <glebfm <at> altlinux.org>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Thu, 14 Sep 2023 22:59:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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





Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sat, 16 Sep 2023 02:45:02 GMT) Full text and rfc822 format available.

Notification sent to Gleb Fotengauer-Malinovskiy <glebfm <at> altlinux.org>:
bug acknowledged by developer. (Sat, 16 Sep 2023 02:45:02 GMT) Full text and rfc822 format available.

Message #10 received at 65984-done <at> debbugs.gnu.org (full text, mbox):

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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 14 Oct 2023 11:24:12 GMT) Full text and rfc822 format available.

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

Previous Next


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