Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 Apr 2023 17:05:08 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 270643] Malformed output when comparing files with lines longer than 512 characters
Message-ID:  <bug-270643-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D270643

            Bug ID: 270643
           Summary: Malformed output when comparing files with lines
                    longer than 512 characters
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: siegel@barebones.com

Created attachment 241299
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D241299&action=
=3Dedit
Zip archive containing example files and output

When comparing files which have lines longer than 512 characters, the output
generated by `diff` truncates the long line, *and* fails to add a line break
after it. This causes the next diff indicator to be missed.

- unzip the attached archive ("VenturaDiffBug.zip").

- open a Terminal window, and cd into the resulting folder.

- run this command:

      `diff --text file2.txt file1.txt`

Expected result:

=3D> The output should look like:

```
1d0
< -     617149952       616901632       616308736       615692800=20=20=20=
=20=20=20
615050752       614669312       613733120       612807680       612417792=
=20=20=20=20=20=20
611426560       611000320       610260480       609772544       609525504=
=20=20=20=20=20=20
609511936       609338880... (remainder omitted for brevity)
2a2
> -	617149952	616901632=09
```

Actual result:

=3D> The first "<" diff gets truncated at exactly 512 characters, and then =
the
second diff is appended immediately thereafter with no intervening line bre=
ak,
so the output looks like this (see `diffoutput.txt` in the archive):

```
1d0
< -     617149952       616901632       [...omitted for brevity...] 6044454=
42a2
> -	617149952	616901632=09
```

Note the "`2a2`" at the end of the first line of context; this should start=
 on
a new line, but doesn't. Consequently, interpreting the diff output presents
incorrect results to the user.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-270643-227>