summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
Diffstat (limited to 'op.c')
-rw-r--r--op.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/op.c b/op.c
index 689fc18aba..19be53507e 100644
--- a/op.c
+++ b/op.c
@@ -5862,7 +5862,13 @@ Perl_ck_require(pTHX_ OP *o)
--SvCUR(kid->op_sv);
}
}
- sv_catpvn(kid->op_sv, ".pm", 3);
+ if (SvREADONLY(kid->op_sv)) {
+ SvREADONLY_off(kid->op_sv);
+ sv_catpvn(kid->op_sv, ".pm", 3);
+ SvREADONLY_on(kid->op_sv);
+ }
+ else
+ sv_catpvn(kid->op_sv, ".pm", 3);
}
}
return ck_fun(o);