From ce3b816e7fbb57d1e6fa36b1ffbe584312f4d591 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Thu, 9 Mar 2000 06:26:04 +0000 Subject: [PATCH] demand-load utf8.pm in swash routines p4raw-id: //depot/perl@5622 --- op.c | 8 +++++++- utf8.c | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/op.c b/op.c index 689fc18..19be535 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); diff --git a/utf8.c b/utf8.c index ff113f9..212c555 100644 --- a/utf8.c +++ b/utf8.c @@ -670,6 +670,13 @@ Perl_swash_init(pTHX_ char* pkg, char* name, SV *listsv, I32 minbits, I32 none) SV* retval; char tmpbuf[256]; dSP; + + if (!gv_stashpv(pkg, 0)) { /* demand load utf8 */ + ENTER; + Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, newSVpv(pkg,0), Nullsv); + LEAVE; + } + SPAGAIN; PUSHSTACKi(PERLSI_MAGIC); PUSHMARK(SP); EXTEND(SP,5); -- 2.7.4