From: Gurusamy Sarathy Date: Thu, 9 Mar 2000 06:26:04 +0000 (+0000) Subject: demand-load utf8.pm in swash routines X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ce3b816e7fbb57d1e6fa36b1ffbe584312f4d591;p=p5sagit%2Fp5-mst-13.2.git demand-load utf8.pm in swash routines p4raw-id: //depot/perl@5622 --- 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);