Skip to content

Commit

Permalink
Move some variables in S_init_postdump_symbols() to a tighter scope.
Browse files Browse the repository at this point in the history
  • Loading branch information
nwc10 committed Aug 23, 2021
1 parent ae9fbee commit 43231a2
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions perl.c
Expand Up @@ -4587,9 +4587,6 @@ S_init_postdump_symbols(pTHX_ int argc, char **argv, char **env)
environ[0] = NULL;
}
if (env) {
char *s, *old_var;
STRLEN nlen;
SV *sv;
HV *dups = newHV();
char **env_copy = env;
size_t count;
Expand All @@ -4612,16 +4609,20 @@ S_init_postdump_symbols(pTHX_ int argc, char **argv, char **env)


for (; *env; env++) {
old_var = *env;
char *old_var = *env;
char *s = strchr(old_var, '=');
STRLEN nlen;
SV *sv;

if (!(s = strchr(old_var,'=')) || s == old_var)
continue;
nlen = s - old_var;
if (!s || s == old_var)
continue;

nlen = s - old_var;

#if defined(MSDOS) && !defined(DJGPP)
*s = '\0';
(void)strupr(old_var);
*s = '=';
*s = '\0';
(void)strupr(old_var);
*s = '=';
#endif
if (hv_exists(hv, old_var, nlen)) {
const char *name = savepvn(old_var, nlen);
Expand Down

0 comments on commit 43231a2

Please sign in to comment.