freebsd-skq/usr.bin/diff
Kyle Evans ac05de1788 diff: fix side_by_side after r363679
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
2020-07-30 13:33:45 +00:00
..
tests diff: fix side_by_side after r363679 2020-07-30 13:33:45 +00:00
diff.1 diff(1): Add EXAMPLES section 2020-06-19 06:48:16 +00:00
diff.c diff: restore compatibility with GNU diff regarding -N option 2020-06-01 09:09:36 +00:00
diff.h diff(1): reject conflicting formatting options 2020-04-20 16:14:44 +00:00
diffdir.c diff: Import fixes from OpenBSD 2018-06-09 21:09:24 +00:00
diffreg.c diff: implement -y (--side-by-side) along with -W and --suppress-common-lines 2020-02-07 10:17:13 +00:00
Makefile Isolate the pr(1) related code in its own source files 2018-06-09 20:24:17 +00:00
pr.c Fix memory leak 2018-06-12 16:42:11 +00:00
pr.h Isolate the pr(1) related code in its own source files 2018-06-09 20:24:17 +00:00
TODO Update diff(1) TODO removing what has been implemented 2020-02-07 10:18:01 +00:00
xmalloc.c asprintf returns -1, not an arbitrary value < 0. Also upon error the 2020-01-14 08:18:04 +00:00
xmalloc.h