summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-10-09 17:56:13 +0000
committerNicholas Clark <nick@ccl4.org>2007-10-09 17:56:13 +0000
commit50b8ed39c726ebc47ad88ac004e8c85b9833a11a (patch)
tree471cfdb93cafa97f81ca8a2d8437238615a369c1 /pp_ctl.c
parentb0927e1012afcb404c9a3bbd8eb9a420f579ebc5 (diff)
downloadperl-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.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 774bcb52fc..af400619c5 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);
}