aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/diff/diffdir.c
Commit message (Collapse)AuthorAgeFilesLines
* diff: Don't compare a file or directory to itselfDag-Erling Smørgrav2026-02-111-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | While here, stop abusing struct dirent for something we don't even need to store. Approved by: re (cperciva) PR: 254455 MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: thj, kevans Differential Revision: https://reviews.freebsd.org/D55113 (cherry picked from commit 590126789c841d80655869bc075c8980c173dd1c) diff: Fix build rc must be defined first. Fixes: 590126789c84 MFC after: 1 week X-MFC with: 590126789c84 (cherry picked from commit ee44ab936e84bacaa49847d36aabdf280f9fecce) (cherry picked from commit 7f412c6f88edc3aafb53a83f1743ad49da4679a9)
* libc: Rename fscandir{,_b}() to fdscandir{,_b}().Dag-Erling Smørgrav2026-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 (cherry picked from commit 0a5b763d98b921f921243525ff25a70bbe00cfaa) libc: Finish removing fscandir{,_b}(). These only existed for a few days before being renamed, so there's no reason to continue to carry compatibility shims for them. Fixes: deeebfdecab5 Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D50981 (cherry picked from commit ccf937320a1a7383a2c33698007b7244f66dc022)
* diff: Fix gcc build.Dag-Erling Smørgrav2026-02-051-3/+3
| | | | | | Sponsored by: Klara, Inc. (cherry picked from commit 28d9586cde8dc783f7b698b10c2b564fde14ae74)
* diff: Detect loops when diffing directories.Dag-Erling Smørgrav2026-02-051-10/+75
| | | | | | | | Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D50936 (cherry picked from commit 42092e1b6625b8226de5f34d22b9a96c713626cb)
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* diff: fix failed compare when ignoring file caseTom Jones2022-02-181-9/+18
| | | | | | | | | | | | 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
* diff: add --no-dereference flagTom Jones2022-02-181-17/+77
| | | | | | | | | 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
* diff: move functions around and reduce their visibilityPiotr Pawel Stefaniak2021-09-151-0/+9
| | | | | | 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.
* diff: Import fixes from OpenBSDBaptiste Daroussin2018-06-091-6/+6
| | | | | | | | | 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
* Fix exit status with -rq when there is a file in one directory but not another,Enji Cooper2017-07-171-2/+6
| | | | | | | | | | | | | | | | | | 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
* Clean up headers declarationBaptiste Daroussin2017-04-151-4/+0
| | | | Notes: svn path=/head/; revision=316959
* Fix building with recent gccBaptiste Daroussin2017-03-121-0/+2
| | | | | | | Reported by: lwhsu, ngie Notes: svn path=/head/; revision=315107
* Import diff from OpenBSD and remove GNU diffBaptiste Daroussin2017-03-111-0/+237
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