summaryrefslogtreecommitdiff
path: root/usr.bin/diff/diffdir.c
AgeCommit message (Collapse)Author
2025-06-23libc: Rename fscandir{,_b}() to fdscandir{,_b}().Dag-Erling Smørgrav
This seems to fit the pattern better (e.g. fdopendir()). I've added weak references to ease the transition, but since it's only been a few days, we can remove them (and the ObsoleteFiles entries for the manual pages) before we branch stable/15. Fixes: deeebfdecab5 Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D50980
2025-06-20diff: Fix gcc build.Dag-Erling Smørgrav
Sponsored by: Klara, Inc.
2025-06-20diff: Detect loops when diffing directories.Dag-Erling Smørgrav
Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D50936
2024-05-03diff: Sort headers.Dag-Erling Smørgrav
MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D45078
2024-03-27diff: Integrate libdiff from OpenBSD GoT.Dag-Erling Smørgrav
This adds support for two new diff algorithms, Myers diff and Patience diff. These algorithms perform a different form of search compared to the classic Stone algorithm and support escapes when worst case scenarios are encountered. Add the -A flag to allow selection of the algorithm, but default to using the new Myers diff implementation. The libdiff implementation currently only supports a subset of input and output options supported by diff. When these options are used, but the algorithm is not selected, automatically fallback to the classic Stone algorithm until support for these modes can be added. Based on work originally done by thj@ with contributions from kevans@. Sponsored by: Klara, Inc. Reviewed by: thj Differential Revision: https://reviews.freebsd.org/D44302
2023-08-16Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2022-02-18diff: fix failed compare when ignoring file caseTom Jones
With --ignore-file-name-case we need to compare files regardless of case. We need to propigate both names down to diffit so we can look up the correct file when the names differ based on case, otherwise we try to look up the file using the case from the a tree which might not be discoverable if its case is different in the b tree. Reviewed by: bapt Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D34201
2022-02-18diff: add --no-dereference flagTom Jones
When diffing files and directories, don't follow symbolic links, instead compare where the links point to. Reviewed by: bapt Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D34203
2021-09-16diff: move functions around and reduce their visibilityPiotr Pawel Stefaniak
Most of them become static. There will be more such functions added in upcoming commits, so they would be inconsistent with existing code. Improve the existing code instead of reinforcing the unwanted pattern.
2018-06-09diff: Import fixes from OpenBSDBaptiste Daroussin
original commit log by miller@OpenBSD r1.46: Fix exit value when diffing directories with missing files and the -N or -P options are not used. From Ibrahim Khalifa Notes: svn path=/head/; revision=334896
2017-07-17Fix exit status with -rq when there is a file in one directory but not another,Enji Cooper
i.e., when print_only is called. Prior to this change, -rq was always returning 0. After this change it will return 1 if there is a difference between two directories. This fixes compatibility with GNU diff and unbreaks backwards compatibility expectations. Found when trying to extend diff_test:brief_format_test. MFC after: 2 months MFC with: r321076, r321077 Notes: svn path=/head/; revision=321078
2017-04-15Clean up headers declarationBaptiste Daroussin
Notes: svn path=/head/; revision=316959
2017-03-12Fix building with recent gccBaptiste Daroussin
Reported by: lwhsu, ngie Notes: svn path=/head/; revision=315107
2017-03-11Import diff from OpenBSD and remove GNU diffBaptiste Daroussin
Some of the modifications from the previous summer of code has been integrated Modification for compatibility with GNU diff output has been added Main difference with OpenBSD: Implement multiple GNU diff options: * --ignore-file-name-case * --no-ignore-file-name-case * --normal * --tabsize * --strip-trailing-cr Make diff -p compatible with GNU diff Implement diff -l Make diff -r compatible with GNU diff Capsicumize diffing 2 regular files Add a simple test suite Approved by: AsiaBSDcon devsummit Obtained from: OpenBSD, GSoC Relnotes: yes Notes: svn path=/head/; revision=315051