From: Nicholas Clark Date: Tue, 9 Oct 2007 17:56:13 +0000 (+0000) Subject: Remove a call to *printf from the require code. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=50b8ed39c726ebc47ad88ac004e8c85b9833a11a;p=p5sagit%2Fp5-mst-13.2.git Remove a call to *printf from the require code. p4raw-id: //depot/perl@32085 --- diff --git a/pp_ctl.c b/pp_ctl.c index 774bcb5..af40061 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -3026,9 +3026,14 @@ S_doopen_pm(pTHX_ const char *name, const char *mode) PerlIO *fp; if (namelen > 3 && strEQ(name + namelen - 3, ".pm")) { - SV * const pmcsv = Perl_newSVpvf(aTHX_ "%s%c", name, 'c'); - const char * const pmc = SvPV_nolen_const(pmcsv); + SV *const pmcsv = newSV(namelen + 2); + char *const pmc = SvPVX(pmcsv); Stat_t pmcstat; + + memcpy(pmc, name, namelen); + pmc[namelen] = 'c'; + pmc[namelen + 1] = '\0'; + if (PerlLIO_stat(pmc, &pmcstat) < 0) { fp = check_type_and_open(name, mode); }