HomeFreeBSD

awk: revert upstream's attempt to disallow hex strings

Description

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 prior standards, but not the latest POSIX
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

Note: This is re-done in stable/14 because the release notes say 15 and
newer will have this restriction, implying stable/14 will not, but the
OTA 2nd edition merge neglected to have this, breaking kernel.bin in
arm*.

(cherry picked from commit d4d252c49976de33d0a2926df733744d0b8d95fa)

Details

Provenance
impAuthored on Apr 15 2024, 10:59 PM
Reviewer
kevans
Differential Revision
D31199: awk: revert upstream's attempt to disallow hex strings
Parents
rG89dd0612d933: netinet: The tailq_hash code doesn't reference tcpoutflags
Branches
Unknown
Tags
Unknown