SP -= 4;
for (i = 1; i <= 3; i++) {
SV *sv = SP[i];
- if (SvOK(sv) && SvREADONLY(sv)) {
+ if (!SvOK(sv))
+ continue;
+ if (SvREADONLY(sv)) {
if (SvIsCOW(sv))
sv_force_normal_flags(sv, 0);
- if (SvREADONLY(sv))
+ if (SvREADONLY(sv) && !(SvPOK(sv) && SvCUR(sv) == 0))
DIE(aTHX_ PL_no_modify);
}
- if (!SvOK(sv))
- continue;
if (!SvPOK(sv)) {
if (ckWARN(WARN_MISC))
Perl_warner(aTHX_ packWARN(WARN_MISC), "Non-string passed as bitmask");
for (i = 1; i <= 3; i++) {
sv = SP[i];
- if (!SvOK(sv)) {
+ if (!SvOK(sv) || SvCUR(sv) == 0) {
fd_sets[i] = 0;
continue;
}
require 'test.pl';
-plan (6);
+plan (9);
my $blank = "";
eval {select undef, $blank, $blank, 0};
is ($@, "");
eval {select "", $blank, $blank, 0};
-like ($@, qr/^Modification of a read-only value attempted/);
+is ($@, "");
eval {select $blank, "", $blank, 0};
-like ($@, qr/^Modification of a read-only value attempted/);
+is ($@, "");
eval {select $blank, $blank, "", 0};
+is ($@, "");
+
+eval {select "a", $blank, $blank, 0};
+like ($@, qr/^Modification of a read-only value attempted/);
+eval {select $blank, "a", $blank, 0};
+like ($@, qr/^Modification of a read-only value attempted/);
+eval {select $blank, $blank, "a", 0};
like ($@, qr/^Modification of a read-only value attempted/);