Branch: refs/heads/hv/gh19010-rebase Home: https://github.com/Perl/perl5 Commit: be7b004b1e3e6a1a160534714ed801c37d0dbf60 https://github.com/Perl/perl5/commit/be7b004b1e3e6a1a160534714ed801c37d0dbf60 Author: Hugo van der Sanden <h...@crypt.org> Date: 2022-02-26 (Sat, 26 Feb 2022)
Changed paths: M ext/XS-APItest/t/grok.t M numeric.c Log Message: ----------- gh19010: fix returns for Perl_grok_infnan Consistently honour what the docs have always promised: If an infinity or a not-a-number is recognized, C<*sp> will point to one byte past the end of the recognized string. If the recognition fails, zero is returned, and C<*sp> will not move. Additionally, restore Perl_grok_number_flags to allowing inf/nan with trailing garbage only when called with PERL_SCAN_TRAILING; add notes to the other two core callers to clarify that they always accept such trailing garbage. Whitespace handling is regularized: trailing whitespace after anything successfully parsed is always accepted, and does not trigger setting IS_NUMBER_TRAILING. A small number of XS-APItest tests were modified to reflect the stricter behaviour: "Infin" and "nanx" are now invalid without PERL_SCAN_TRAILING. An additional inconsistency (GH #19464) is commented in the tests but not addressed here.