GNU bug report logs - #16864
overlapping chunks with the -I option

Previous Next

Package: diffutils;

Reported by: Vincent Lefevre <vincent <at> vinc17.net>

Date: Mon, 24 Feb 2014 14:33:03 UTC

Severity: normal

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 16864 in the body.
You can then email your comments to 16864 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#16864; Package diffutils. (Mon, 24 Feb 2014 14:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vincent Lefevre <vincent <at> vinc17.net>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Mon, 24 Feb 2014 14:33:04 GMT) Full text and rfc822 format available.

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

From: Vincent Lefevre <vincent <at> vinc17.net>
To: bug-diffutils <at> gnu.org
Subject: overlapping chunks with the -I option
Date: Mon, 24 Feb 2014 15:31:37 +0100
Consider two files:

file1:
1a
2
3a
4
5
6

file2:
1b
2
3b
4
5
6
7

With diff (GNU diffutils) 3.3 under Debian/unstable, I get:

$ diff -u -I3 file1 file2
--- file1       2014-02-24 12:58:12.485367096 +0100
+++ file2       2014-02-24 12:58:08.879933593 +0100
@@ -1,6 +1,6 @@
-1a
+1b
 2
-3a
+3b
 4
 5
 6
@@ -4,3 +4,4 @@
 4
 5
 6
+7

i.e. with overlapping chunks. Ditto with the latest patches.
Here I would expect:

--- file1       2014-02-24 12:58:12.485367096 +0100
+++ file2       2014-02-24 12:58:08.879933593 +0100
@@ -1,6 +1,7 @@
-1a
+1b
 2
-3a
+3b
 4
 5
 6
+7

Note that if the 3rd line is the same in both files, one gets
only one chunk:

@@ -1,6 +1,7 @@
-1a
+1b
 2
 3
 4
 5
 6
+7

so that getting 2 chunks with -I is definitely unexpected.

-- 
Vincent Lefèvre <vincent <at> vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Tue, 25 Feb 2014 06:02:02 GMT) Full text and rfc822 format available.

Notification sent to Vincent Lefevre <vincent <at> vinc17.net>:
bug acknowledged by developer. (Tue, 25 Feb 2014 06:02:03 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Vincent Lefevre <vincent <at> vinc17.net>, 16864-done <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#16864: overlapping chunks with the -I option
Date: Mon, 24 Feb 2014 22:01:05 -0800
[Message part 1 (text/plain, inline)]
Thanks for reporting that.  I applied the attached patches.  The first 
fixes the bug and adds a test case, the second fixes some unlikely and 
hard-to-test-for integer-overflow bugs I noticed while I was in the 
neighborhood.
[0001-diff-fix-bug-with-I-and-overlapping-hunks.patch (text/plain, attachment)]
[0002-diff-sdiff-minor-integer-overflow-fixes.patch (text/plain, attachment)]

Information forwarded to bug-diffutils <at> gnu.org:
bug#16864; Package diffutils. (Tue, 25 Feb 2014 16:23:01 GMT) Full text and rfc822 format available.

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

From: Jim Meyering <jim <at> meyering.net>
To: 16864 <at> debbugs.gnu.org, Paul Eggert <eggert <at> cs.ucla.edu>, 
 Vincent Lefevre <vincent <at> vinc17.net>
Cc: 16864-done <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#16864: bug#16864: overlapping chunks with the
 -I option
Date: Tue, 25 Feb 2014 08:21:54 -0800
On Mon, Feb 24, 2014 at 10:01 PM, Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> Thanks for reporting that.  I applied the attached patches.  The first fixes
> the bug and adds a test case, the second fixes some unlikely and
> hard-to-test-for integer-overflow bugs I noticed while I was in the
> neighborhood.

Nice!




Information forwarded to bug-diffutils <at> gnu.org:
bug#16864; Package diffutils. (Tue, 25 Feb 2014 16:23:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 26 Mar 2014 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 89 days ago.

Previous Next


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