Bug 2196671 - diff -D NEW doesn't generate #ifdef lines
Summary: diff -D NEW doesn't generate #ifdef lines
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: diffutils
Version: 38
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-09 19:51 UTC by Ralph Campbell
Modified: 2023-07-01 01:45 UTC (History)
1 user (show)

Fixed In Version: diffutils-3.10-1.fc38
Doc Type: ---
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-07-01 01:45:41 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ralph Campbell 2023-05-09 19:51:28 UTC
I'm using diffutils 3.9. I also compiled from source and see the same issue.

file1:
Here is some old line.

file2:
Here is some new line.

% diff-3.8 -D NEW file1 file2
#ifndef NEW
Here is some old line.
#else /* NEW */
Here is some new line.
#endif /* NEW */

% diff-3.9 -D NEW file1 file2:
Here is some old line.
Here is some new line.


Reproducible: Always

Steps to Reproduce:
1. use "diff -D NEW file1 file2" where file1 and file2 are different
2.
3.
Actual Results:  
Here is some old line.
Here is some new line.

Expected Results:  
#ifndef NEW
Here is some old line.
#else /* NEW */
Here is some new line.
#endif /* NEW */

I compiled diffutils 3.8 from GNU and it works OK.

Comment 1 Ralph Campbell 2023-05-09 21:59:07 UTC
I see it is fixed in the upstream git tree: https://git.savannah.gnu.org/git/diffutils.git

The fix is to src/diff.c line 419: (in the diffutils-3.9 source)
< for (i = 0; i < sizeof sizeof C_ifdef_group_formats; i++)
> for (i = 0; i < sizeof C_ifdef_group_formats; i++)

Comment 2 Fedora Update System 2023-06-29 13:23:22 UTC
FEDORA-2023-40ec8ba630 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-40ec8ba630

Comment 3 Fedora Update System 2023-06-30 01:40:02 UTC
FEDORA-2023-40ec8ba630 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-40ec8ba630`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-40ec8ba630

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2023-07-01 01:45:41 UTC
FEDORA-2023-40ec8ba630 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.