]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
awk: Make -F '' and -v FS="" behave the same
authorWarner Losh <imp@FreeBSD.org>
Tue, 20 Jul 2021 04:47:30 +0000 (22:47 -0600)
committerWarner Losh <imp@FreeBSD.org>
Sat, 31 Jul 2021 00:02:51 +0000 (18:02 -0600)
commitab1dedd4946098fe7202e825d299a2cbec81dae0
tree42e11cc9abc47fb17a3cd105f871b166e6e2812b
parent97de70c68dd78ec73f30d07ab46b5b4dd490e031
awk: Make -F '' and -v FS="" behave the same

IEEE Std 1003.1-2008 mandates that -F str be treated the same as -v
FS=str. For a null string, this was not the case. Since awk(1) documents
that a null string for FS has a specific behavior, make -F '' behave
consistently with -v FS="".

PR: 241441
Upstream issue: https://github.com/onetrueawk/awk/issues/127
Upstream pull request: https://github.com/onetrueawk/awk/pull/128
MFC After: 2 weeks
Sponsored by: Netflix

(cherry picked from commit a2e3e1187309f9404940b61ca49a93bd0536559d)
contrib/one-true-awk/main.c