| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously -q (just print a line when files differ) ignored flags like
-w (ignore whitespace). Avoid the D_BRIEF short-circuit when flags are
in effect.
PR: 252515
Reported by: Scott Aitken
Reviewed by: kevans
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28064
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead, leave the fomat as unspecified (if it hasn't been) and use the
-p flag as a hint to 'context' if no other formatting option is specified.
This fixes `diff -purw`, used frequently by emaste, and matches the behavior
of its GNU counterpart.
PR: 250015
Reviewed by: emaste
MFC after: 1 week
Notes:
svn path=/head/; revision=367076
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When diff is invoked with -l it will spawn the pr(1) program.
In some circumpstances the pr(1) was not properly killed when diff program
exits.
Submitted by: Bret Ketchum
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D26232
Notes:
svn path=/head/; revision=365041
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's currently unclear to me how this could have worked previously; \n here
is not a literal newline but actual '\' 'n', and was getting passed to the
underlying regex engine as such. regex(3) does not translate this to a
newline, and this became an error because we don't really allow escaping
of arbitrary ordinary characters anymore.
Run the pattern strings through printf to make sure we're dealing with real
newlines before passing them through to atf_check, which ultimately feeds
them directly to regcomp(3).
This fix is different than that will be needed for sed, in that this is the
proper way to inject newlines into search strings as long as regex(3)
won't combine \ + n as folks might expect.
Reported by: Jenkins via lwhsu
MFC after: 1 week
Notes:
svn path=/head/; revision=363692
|
|
|
|
|
|
|
|
|
|
| |
Add examples for -r, -u, -N, -x, -q and -I
Approved by: 0mp@
Differential Revision: https://reviews.freebsd.org/D25345
Notes:
svn path=/head/; revision=362367
|
|
|
|
|
|
|
|
|
|
| |
PR: 234195
Submitted by: Fehmi Noyan Isi <fnoyanisi@yahoo.com>
Reported by: Andras Farkas <deepbluemistake@gmail.com>
MFC after: 3 days
Notes:
svn path=/head/; revision=361690
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When -N is used the missing files are treated as empty.
PR: 233402
Submitted by: Fehmi Noyan Isi <fnoyanisi@yahoo.com>
Reported by: Roman Neuhauser <roman@sigpipe.cz>
MFC after: 3 days
Differential Revision: D25081
Notes:
svn path=/head/; revision=361689
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Various options to "diff(1)" show filenames, and traditionally make use of the
"--label" parameter, if set.
Restore this behaviour in BSD diff.
While here add a regression test
PR: 244533
Submitted by: Jamie Landeg-Jones <jamie@catflap.org>
MFC after: 3 days
Notes:
svn path=/head/; revision=361688
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This may happen, for instance, if one happens to have an alias of diff to
diff -up and attempts to specify the amount of context on top of that.
Aliases like this may cause other problems, but if they're really not ever
generating non-unified diffs then we should at least not break that
use-case.
In addition, we'll now pick up a format mismatch if -p is specified with
!contextual && !unified && !unset.
Fix up a small trailing whitespace nit in the tests while we're here, and
add tests to make sure that we can double up all the formatting options.
Reported by: jbeich
MFC after: 3 days
Notes:
svn path=/head/; revision=360437
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This matches GNU diff(1) behavior and, more importantly, eliminates any
source of confusion if multiple formatting options are specified.
Note that the committed diff differs slightly from the submitted: I've
modified it so that we initialize diff_format to something that isn't an
accepted format option so that we can also reject --normal -c and -c
--normal, which would've otherwise been accepted because the default was
--normal. After option parsing we default it to D_NORMAL if it's still
unset.
PR: 243975
Submitted by: fehmi noyan isi
MFC after: 1 week
Notes:
svn path=/head/; revision=360125
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--tabsize was previously listed as optional_argument, but didn't account for
the optionality of it in the argument handling. This is irrelevant -- the
manpage doesn't indicate that the argument is optional, and indeed there's
no clear interpretation of omitting the argument because there's no other
side effect of --tabsize.
The "malformed" argument part of the header on this message is simply
referring to usage like this:
% diff --tabsize 4 A B
With an optional_argument, the argument must be attached to the parameter
directly (e.g. --tabsize=4), so the argument is effectively NULL with the
above invocation as if no argument had been passed.
PR: 243974
Submitted by: fehmi noyan isi <fnoyanisi yahoo com> (diff.c portion)
MFC after: 3 days
Notes:
svn path=/head/; revision=357875
|
|
|
|
|
|
|
|
|
|
|
| |
- Long options must be stylized with the Fl macro as well.
Reviewed by: bapt
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D23642
Notes:
svn path=/head/; revision=357841
|
|
|
|
| |
Notes:
svn path=/head/; revision=357652
|
|
|
|
| |
Notes:
svn path=/head/; revision=357649
|
|
|
|
|
|
|
|
|
| |
PR: 219933
Submitted by: fehmi noyan isi <fnoyanisi@yahoo.com>
MFC after: 3 weeks
Notes:
svn path=/head/; revision=357648
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a regression from r356695.
Submitted by: kevans
Reported by: Jenkins via lwhsu
MFC after: 6 days
Notes:
svn path=/head/; revision=356731
|
|
|
|
|
|
|
|
|
|
| |
value < 0. errno is only updated in this case.
Obtained from: OpenBSD
MFC after: 3 days
Notes:
svn path=/head/; revision=356725
|
|
|
|
|
|
|
|
|
|
|
| |
(very sloppy specification) leaves an undefined value in *ret, so it is
wrong to inspect it, the error condition is enough.
Obtained from: OpenBSD
MFC after: 3 days
Notes:
svn path=/head/; revision=356724
|
|
|
|
|
|
|
|
| |
Obtained from: OpenBSD
MFC after: 3 days
Notes:
svn path=/head/; revision=356723
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Once we know whether the files differ, we don't need to do any further
work.
PR: 242828
Submitted by: fehmi noyan isi <fnoyanisi@yahoo.com> (original version)
Reviewed by: bapt, kevans
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23152
Notes:
svn path=/head/; revision=356695
|
|
|
|
|
|
|
| |
Use caph_{rights,ioctls,fcntls}_limit to simplify the code.
Notes:
svn path=/head/; revision=340138
|
|
|
|
|
|
|
|
|
| |
Instead of doing a second pass to skip empty lines if we've specified -I, go
ahead and check both at once. Ignore critera has been split out into its own
function to try and keep the logic cleaner.
Notes:
svn path=/head/; revision=338040
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As noted by cem in r338035, coccinelle invokes diff(1) with the -B flag.
This was not previously implemented here, so one was forced to create a link
for GNU diff to /usr/local/bin/diff
Implement the -B flag and add some primitive tests for it. It is implemented
in the same fashion that -I is implemented; each chunk's lines are scanned,
and if a non-blank line is encountered then the chunk will be output.
Otherwise, it's skipped.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=338039
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Advance ctold for f1 and ctnew for f2
- ungetc() if the character is unexpected
- Don't break early when we hit the combination on one side
PR: 230049
Reported by: maskray <emacsray gmail com>
Reviewed by: bapt, maskray
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16451
Notes:
svn path=/head/; revision=336754
|
|
|
|
|
|
|
| |
No functional change intended.
Notes:
svn path=/head/; revision=335395
|
|
|
|
|
|
|
| |
CID: 1393352
Notes:
svn path=/head/; revision=335002
|
|
|
|
|
|
|
| |
CID: 1393351
Notes:
svn path=/head/; revision=335001
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
This keeps diffreg.c closer to what it is supposed to do:
diffing regular files.
It also allows my code to get a proper license
Notes:
svn path=/head/; revision=334894
|
|
|
|
|
|
|
| |
This will help in the futur making diff -i works with multibyte
Notes:
svn path=/head/; revision=326822
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
Initially, only tag files that use BSD 4-Clause "Original" license.
RelNotes: yes
Differential Revision: https://reviews.freebsd.org/D13133
Notes:
svn path=/head/; revision=325966
|
|
|
|
|
|
|
| |
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=325187
|
|
|
|
|
|
|
|
|
| |
`SUBDIR.${MK_TESTS}+= tests` idiom.
This is a follow up to r321912.
Notes:
svn path=/projects/make-check-sandbox/; revision=321914
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
directories to SUBDIR.${MK_TESTS} idiom
This is being done to pave the way for future work (and homogenity) in
^/projects/make-check-sandbox .
No functional change intended.
MFC after: 1 weeks
Notes:
svn path=/head/; revision=321912
|
|
|
|
|
|
|
|
|
|
|
| |
contrib/netbsd-tests/usr.bin/diff/t_diff.sh with the name of the script via
`basename $0`.
This was a change I forgot to port over from
^/head/gnu/usr.bin/diff/tests/Makefile@r272787.
Notes:
svn path=/head/; revision=321227
|
|
|
|
|
|
|
|
| |
MFC after: 2 months
MFC with: r321076, r321077, r321078
Notes:
svn path=/head/; revision=321079
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
MFC after: 2 months
MFC with: r321076
Notes:
svn path=/head/; revision=321077
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-q is specified.
This improves compatibility with GNU diff.
Found by accident with `diff -Nrq /usr/tests /usr/tests.new | grep Kyuafile`.
MFC after: 2 months
Relnotes: yes
Notes:
svn path=/head/; revision=321076
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are were created proactively, in anticipation of the support being
fully implemented sometime in the future.
The tests currently fail on ^/head@r319845, however. Expect them to fail.
PR: 219933
Tested with: gdiff
Notes:
svn path=/head/; revision=319847
|
|
|
|
|
|
|
|
|
|
|
| |
This is undocumented to match GNU diff where -H is also undocumented.
Some existing software (such as kompare) uses this option by default.
Reviewed by: emaste, rpokala
Differential Revision: https://reviews.freebsd.org/D11022
Notes:
svn path=/head/; revision=319489
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
usr.bin/diff/diffreg.c: In function 'change':
usr.bin/diff/diffreg.c:1085: warning: 'i' may be used uninitialized in this function
This version of gcc is not smart enough to see that 'i' cannot actually
be used unitialized. However, the variable is confusingly re-used, so
it is better to give it another name, and clearly initialize it before
attempting to use it.
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D10484
Notes:
svn path=/head/; revision=317381
|
|
|
|
| |
Notes:
svn path=/head/; revision=317207
|
|
|
|
| |
Notes:
svn path=/head/; revision=317206
|
|
|
|
| |
Notes:
svn path=/head/; revision=317205
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
etcupdate(8) requires that option, while GNU diff supports many more variation
of that options, their behaviour beside the simple verion implemented here are
quite inconsistent as such I do not plan to implement those.
The only special keyword supported by this implementation are: %< and %>
%= is not implemented as the documentation of GNU diff says: common lines, but
it actually when tested print the changes from the first file
Notes:
svn path=/head/; revision=317194
|
|
|
|
| |
Notes:
svn path=/head/; revision=317187
|
|
|
|
| |
Notes:
svn path=/head/; revision=316959
|
|
|
|
|
|
|
|
| |
There is no intention to implement it, but lots of scripts/tools using
diff(1) passes GNU diff option
Notes:
svn path=/head/; revision=316639
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Show nanoseconds in the -u/-c header line.
The present portability conditionals cannot handle the POSIX standard
st_mtim, so remove them and unconditionally use st_mtim.
PR: 218018
Reported by: jbeich
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D10145
Notes:
svn path=/head/; revision=316002
|