]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r360125: diff(1): reject conflicting formatting options
authorKyle Evans <kevans@FreeBSD.org>
Mon, 27 Apr 2020 22:32:16 +0000 (22:32 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Mon, 27 Apr 2020 22:32:16 +0000 (22:32 +0000)
commit16b191081dbc396875fd99c724de30f263ef5dff
tree15f2af09608253abe9fa4d316fd9b6a24b049185
parent9db00827abd0991f97109c45afbf6d362548f912
MFC r360125: diff(1): reject conflicting formatting options

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