p |OP* |scope |NULLOK OP* o
Ap |char* |screaminstr |NN SV *bigstr|NN SV *littlestr|I32 start_shift \
|I32 end_shift|NN I32 *old_posp|I32 last
-#if !defined(VMS) && defined(PERL_IN_UTIL_C)
-s |I32 |setenv_getix |NN const char* nam
-#endif
Apd |void |setdefout |NULLOK GV* gv
Ap |HEK* |share_hek |NN const char* str|I32 len|U32 hash
#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
#define scope Perl_scope
#endif
#define screaminstr Perl_screaminstr
-#if !defined(VMS) && defined(PERL_IN_UTIL_C)
-#ifdef PERL_CORE
-#define setenv_getix S_setenv_getix
-#endif
-#endif
#define setdefout Perl_setdefout
#define share_hek Perl_share_hek
#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
#define scope(a) Perl_scope(aTHX_ a)
#endif
#define screaminstr(a,b,c,d,e,f) Perl_screaminstr(aTHX_ a,b,c,d,e,f)
-#if !defined(VMS) && defined(PERL_IN_UTIL_C)
-#ifdef PERL_CORE
-#define setenv_getix(a) S_setenv_getix(aTHX_ a)
-#endif
-#endif
#define setdefout(a) Perl_setdefout(aTHX_ a)
#define share_hek(a,b,c) Perl_share_hek(aTHX_ a,b,c)
#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
#define PERL_ARGS_ASSERT_SCREAMINSTR \
assert(bigstr); assert(littlestr); assert(old_posp)
-#if !defined(VMS) && defined(PERL_IN_UTIL_C)
-STATIC I32 S_setenv_getix(pTHX_ const char* nam)
- __attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT_SETENV_GETIX \
- assert(nam)
-
-#endif
PERL_CALLCONV void Perl_setdefout(pTHX_ GV* gv);
PERL_CALLCONV HEK* Perl_share_hek(pTHX_ const char* str, I32 len, U32 hash)
__attribute__nonnull__(pTHX_1);
#ifndef PERL_USE_SAFE_PUTENV
if (!PL_use_safe_putenv) {
/* most putenv()s leak, so we manipulate environ directly */
- register I32 i=setenv_getix(nam); /* where does it go? */
+ register I32 i;
+ register const I32 len = strlen(nam);
int nlen, vlen;
+ /* where does it go? */
+ for (i = 0; environ[i]; i++) {
+ if (strnEQ(environ[i],nam,len) && environ[i][len] == '=')
+ break;
+ }
+
if (environ == PL_origenviron) { /* need we copy environment? */
I32 j;
I32 max;
#endif /* WIN32 || NETWARE */
-#ifndef PERL_MICRO
-static I32
-S_setenv_getix(pTHX_ const char *nam)
-{
- register I32 i;
- register const I32 len = strlen(nam);
-
- PERL_ARGS_ASSERT_SETENV_GETIX;
- PERL_UNUSED_CONTEXT;
-
- for (i = 0; environ[i]; i++) {
- if (
-#ifdef WIN32
- strnicmp(environ[i],nam,len) == 0
-#else
- strnEQ(environ[i],nam,len)
-#endif
- && environ[i][len] == '=')
- break; /* strnEQ must come first to avoid */
- } /* potential SEGV's */
- return i;
-}
-#endif /* !PERL_MICRO */
-
#endif /* !VMS && !EPOC*/
#ifdef UNLINK_ALL_VERSIONS