universal.c - utf8::downgrade($x,FAIL_OK) is not supposed to treat FAIL_OK as an integer

This commit is contained in:
Yves Orton 2014-03-21 17:47:45 +01:00
parent b94d11d663
commit 3ca75eca84
2 changed files with 10 additions and 1 deletions

View File

@ -208,6 +208,15 @@ Synchronize POD changes from the CPAN release.
L<perl5db.pl> has been upgraded from version 1.44 to 1.45.
=item *
A mismatch between the documentation and the code in utf8::downgrade()
was fixed in favour of the documentation. The optional second argument
is now correctly treated as a perl boolean (true/false semantics) and
not as an integer.
=item *
fork() in the debugger under C<tmux> will now create a new window for
the forked process. L<[perl
#121333]|https://rt.perl.org/Ticket/Display.html?id=121333>

View File

@ -513,7 +513,7 @@ XS(XS_utf8_downgrade)
croak_xs_usage(cv, "sv, failok=0");
else {
SV * const sv = ST(0);
const bool failok = (items < 2) ? 0 : (int)SvIV(ST(1));
const bool failok = (items < 2) ? 0 : SvTRUE(ST(1)) ? 1 : 0;
const bool RETVAL = sv_utf8_downgrade(sv, failok);
ST(0) = boolSV(RETVAL);