diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-10-09 17:56:13 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-10-09 17:56:13 +0000 |
commit | 50b8ed39c726ebc47ad88ac004e8c85b9833a11a (patch) | |
tree | 471cfdb93cafa97f81ca8a2d8437238615a369c1 /pp_ctl.c | |
parent | b0927e1012afcb404c9a3bbd8eb9a420f579ebc5 (diff) | |
download | perl-50b8ed39c726ebc47ad88ac004e8c85b9833a11a.tar.gz |
Remove a call to *printf from the require code.
p4raw-id: //depot/perl@32085
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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); } |