]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
awk: revert upstream's attempt to disallow hex strings
authorWarner Losh <imp@FreeBSD.org>
Thu, 15 Jul 2021 22:46:06 +0000 (16:46 -0600)
committerWarner Losh <imp@FreeBSD.org>
Thu, 15 Jul 2021 23:27:57 +0000 (17:27 -0600)
commit40a925385fa6b7c1a177880e36aa0fc278043e49
tree4af41578e95e35fcadb290eed8cad1985de91a8a
parentdb306b0b412a0d14c8a25ab5194c82106a09d0e2
awk: revert upstream's attempt to disallow hex strings

Upstream one-true-awk decided to disallow hex strings as numbers. This
is in line with awk's behavior prior to C99, and allowed by the POSIX
standard. The standard, however, allows them to be treated as numbers
because that's what the standard said in the 2001 through 2004 editions.
Since 2001, the nawk in FreeBSD has treated them as numbers, so restore
that behavior, allowed by the standard.

A number of scripts in the FreeBSD tree depend on this interpretation,
including scripts to build the kernel which had mysteriously started
failing for some people and not others. By re-allowing 0x hex numbers,
this fixes those scripts and restores POLA.

Upstream issue: https://github.com/onetrueawk/awk/issues/126
Sponsored by: Netflix
Reviewed by: kevans
MFC After: asap due to regression alrady merged to stable
Differential Revision: https://reviews.freebsd.org/D31199

(cherry picked from commit d4d252c49976de33d0a2926df733744d0b8d95fa)
contrib/one-true-awk/lib.c