summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-02-20 20:09:16 +0000
committerNicholas Clark <nick@ccl4.org>2009-02-20 20:16:12 +0000
commite6a0bbf8b4e00dca6da011b9cb1d8c949b3bfa1e (patch)
tree4fb59c91c234617af3526425a3b8123c2c5a2bab /perl.c
parentfd2c5c6c3907b40a30d10beb189791226562c647 (diff)
downloadperl-e6a0bbf8b4e00dca6da011b9cb1d8c949b3bfa1e.tar.gz
Add a parameter to win32_get_{priv,site,vendor}lib(), to return the length,
as we already know it, and use it in S_init_perllib() to save a strlen() in S_incpush_use_sep().
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/perl.c b/perl.c
index ce6c383534..0aa8dfd04b 100644
--- a/perl.c
+++ b/perl.c
@@ -4094,6 +4094,10 @@ S_init_perllib(pTHX_ U32 old_vers)
{
dVAR;
char *s;
+#ifdef WIN32
+ STRLEN len;
+#endif
+
if (!PL_tainting) {
#ifndef VMS
s = PerlEnv_getenv("PERL5LIB");
@@ -4178,9 +4182,9 @@ S_init_perllib(pTHX_ U32 old_vers)
#ifdef SITELIB_EXP
# if defined(WIN32)
/* this picks up sitearch as well */
- s = win32_get_sitelib(PERL_FS_VERSION);
+ s = win32_get_sitelib(PERL_FS_VERSION, &len);
if (s)
- incpush_use_sep(s, 0, INCPUSH_ADD_SUB_DIRS|INCPUSH_CAN_RELOCATE);
+ incpush_use_sep(s, len, INCPUSH_ADD_SUB_DIRS|INCPUSH_CAN_RELOCATE);
# else
S_incpush_use_sep(aTHX_ STR_WITH_LEN(SITELIB_EXP), INCPUSH_CAN_RELOCATE);
# endif
@@ -4204,9 +4208,9 @@ S_init_perllib(pTHX_ U32 old_vers)
#ifdef PERL_VENDORLIB_EXP
# if defined(WIN32)
/* this picks up vendorarch as well */
- s = win32_get_vendorlib(PERL_FS_VERSION);
+ s = win32_get_vendorlib(PERL_FS_VERSION, &len);
if (s)
- incpush_use_sep(s, 0, INCPUSH_ADD_SUB_DIRS|INCPUSH_CAN_RELOCATE);
+ incpush_use_sep(s, len, INCPUSH_ADD_SUB_DIRS|INCPUSH_CAN_RELOCATE);
# else
S_incpush_use_sep(aTHX_ STR_WITH_LEN(PERL_VENDORLIB_EXP), INCPUSH_CAN_RELOCATE);
# endif
@@ -4228,9 +4232,9 @@ S_init_perllib(pTHX_ U32 old_vers)
#endif
#if defined(WIN32)
- s = win32_get_privlib(PERL_FS_VERSION);
+ s = win32_get_privlib(PERL_FS_VERSION, &len);
if (s)
- incpush_use_sep(s, 0, INCPUSH_ADD_SUB_DIRS|INCPUSH_CAN_RELOCATE);
+ incpush_use_sep(s, len, INCPUSH_ADD_SUB_DIRS|INCPUSH_CAN_RELOCATE);
#else
S_incpush_use_sep(aTHX_ STR_WITH_LEN(PRIVLIB_EXP), INCPUSH_CAN_RELOCATE);
#endif