diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-08-09 20:22:29 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-08-11 07:41:26 -0700 |
commit | ba3062ae5fbdf03fcd307336079938ace26aee2b (patch) | |
tree | f7977ae183078c501c23ee577fccaf8aeb5442d4 /pp_sys.c | |
parent | 958851d8f0bcfcbfc1dd2ad9e869430180974b69 (diff) | |
download | perl-ba3062ae5fbdf03fcd307336079938ace26aee2b.tar.gz |
Stop system select from croaking on read-only COW ""
System select (select with 4 arguments) does not allow any of its
first three arguments to be read-only unless they are undef or
empty strings.
It does not work properly for read-only copy-on-write empty strings,
because it passes all copy-on-write through sv_force_normal under the
expectation that they will shortly be modified. It should not be
doing that for read-only empty strings.
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1112,10 +1112,11 @@ PP(pp_sselect) SvGETMAGIC(sv); if (!SvOK(sv)) continue; - if (SvIsCOW(sv)) - sv_force_normal_flags(sv, 0); - if (SvREADONLY(sv) && !(SvPOK(sv) && SvCUR(sv) == 0)) + if (SvREADONLY(sv)) { + if (!(SvPOK(sv) && SvCUR(sv) == 0)) Perl_croak_no_modify(); + } + else if (SvIsCOW(sv)) sv_force_normal_flags(sv, 0); if (!SvPOK(sv)) { if (!SvPOKp(sv)) Perl_ck_warner(aTHX_ packWARN(WARN_MISC), |