From: Nicholas Clark Date: Fri, 23 Dec 2005 17:24:44 +0000 (+0000) Subject: For the rare case of EMFILE during require, save object code space X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b9b739dc8249ced77343a7411d1a5714224db0f8;p=p5sagit%2Fp5-mst-13.2.git For the rare case of EMFILE during require, save object code space by using newSVpvf (Would it be worth using it for all require failures?) p4raw-id: //depot/perl@26477 --- diff --git a/pp_ctl.c b/pp_ctl.c index 9c8cb83..ad901cc 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -3334,9 +3334,9 @@ PP(pp_require) if (PL_op->op_type == OP_REQUIRE) { const char *msgstr = name; if(errno == EMFILE) { - SV * const msg = sv_2mortal(newSVpv(msgstr,0)); - sv_catpv(msg, ": "); - sv_catpv(msg, Strerror(errno)); + SV * const msg + = sv_2mortal(Perl_newSVpvf(aTHX_ "%s: %s", msgstr, + Strerror(errno))); msgstr = SvPV_nolen_const(msg); } else { if (namesv) { /* did we lookup @INC? */