]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r363692: diff: fix side_by_side
authorKyle Evans <kevans@FreeBSD.org>
Thu, 6 Aug 2020 18:17:19 +0000 (18:17 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Thu, 6 Aug 2020 18:17:19 +0000 (18:17 +0000)
commitb77584983318f698142e5dcd80d727ad43e1f111
treeada1c82cfbe5dcb0f170eec116afa73a44a9f895
parent77cf878b3917db166d90a5bb24b1567925b303f6
MFC r363692: diff: fix side_by_side

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.
usr.bin/diff/tests/diff_test.sh