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.

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#16864: closed (overlapping chunks with the -I option)
Date: Tue, 25 Feb 2014 06:02:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 24 Feb 2014 22:01:05 -0800
with message-id <530C31A1.4030104 <at> cs.ucla.edu>
and subject line Re: [bug-diffutils] bug#16864: overlapping chunks with the -I option
has caused the debbugs.gnu.org bug report #16864,
regarding overlapping chunks with the -I option
to be marked as done.

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


-- 
16864: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16864
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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)


[Message part 3 (message/rfc822, inline)]
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 4 (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)]

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.