From: Nicholas Clark Date: Mon, 16 Feb 2009 22:21:15 +0000 (+0000) Subject: By spliting PERL_ARCH_FMT into PERL_ARCH_FMT_PREFIX and SUFFIX, we can replace X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=96e4a957123c0888bec702f32e27a3e1dfbdc767;p=p5sagit%2Fp5-mst-13.2.git By spliting PERL_ARCH_FMT into PERL_ARCH_FMT_PREFIX and SUFFIX, we can replace two more Perl_sv_setpvf()s with sv_setsv()/sv_catpvs() pairs. --- diff --git a/perl.c b/perl.c index eb31f9e..33dbcc6 100644 --- a/perl.c +++ b/perl.c @@ -4462,15 +4462,18 @@ S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags) #endif if (addsubdirs) { #ifdef MACOS_TRADITIONAL -#define PERL_ARCH_FMT "%s:" +#define PERL_ARCH_FMT_PREFIX "" +#define PERL_ARCH_FMT_SUFFIX ":" #define PERL_ARCH_FMT_PATH PERL_FS_VERSION "" #else -#define PERL_ARCH_FMT "/%s" +#define PERL_ARCH_FMT_PREFIX "/" +#define PERL_ARCH_FMT_SUFFIX "" #define PERL_ARCH_FMT_PATH "/" PERL_FS_VERSION #endif /* .../version/archname if -d .../version/archname */ - Perl_sv_setpvf(aTHX_ subdir, "%"SVf PERL_ARCH_FMT_PATH PERL_ARCH_FMT, - SVfARG(libdir), ARCHNAME); + sv_setsv(subdir, libdir); + sv_catpvs(subdir, PERL_ARCH_FMT_PATH \ + PERL_ARCH_FMT_PREFIX ARCHNAME PERL_ARCH_FMT_SUFFIX); subdir = S_incpush_if_exists(aTHX_ av, subdir); /* .../version if -d .../version */ @@ -4479,8 +4482,9 @@ S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags) subdir = S_incpush_if_exists(aTHX_ av, subdir); /* .../archname if -d .../archname */ - Perl_sv_setpvf(aTHX_ subdir, "%"SVf PERL_ARCH_FMT, - SVfARG(libdir), ARCHNAME); + sv_setsv(subdir, libdir); + sv_catpvs(subdir, + PERL_ARCH_FMT_PREFIX ARCHNAME PERL_ARCH_FMT_SUFFIX); subdir = S_incpush_if_exists(aTHX_ av, subdir); } @@ -4489,7 +4493,8 @@ S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags) if (addoldvers) { for (incver = incverlist; *incver; incver++) { /* .../xxx if -d .../xxx */ - Perl_sv_setpvf(aTHX_ subdir, "%"SVf PERL_ARCH_FMT, + Perl_sv_setpvf(aTHX_ subdir, "%"SVf PERL_ARCH_FMT_PREFIX \ + "%s" PERL_ARCH_FMT_SUFFIX, SVfARG(libdir), *incver); subdir = S_incpush_if_exists(aTHX_ av, subdir); }