summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-12-01 01:00:09 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-12-01 01:00:09 +0000
commit7766f1371a6d2b58d0f46fbe6a60785860a39c1e (patch)
tree700a30f3a9c7640a0c123dc9608fc998df8ecfb4 /mg.c
parent363b4d598618baccb2a68ae886e2608f45cd3cb5 (diff)
downloadperl-7766f1371a6d2b58d0f46fbe6a60785860a39c1e.tar.gz
more complete pseudo-fork() support for Windows
p4raw-id: //depot/perl@4602
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/mg.c b/mg.c
index fdaf3bb005..2b35677e27 100644
--- a/mg.c
+++ b/mg.c
@@ -818,7 +818,10 @@ Perl_magic_clear_all_env(pTHX_ SV *sv, MAGIC *mg)
#if defined(VMS)
Perl_die(aTHX_ "Can't make list assignment to %%ENV on this system");
#else
-# ifdef WIN32
+# ifdef PERL_IMPLICIT_SYS
+ PerlEnv_clearenv();
+# else
+# ifdef WIN32
char *envv = GetEnvironmentStrings();
char *cur = envv;
STRLEN len;
@@ -834,13 +837,13 @@ Perl_magic_clear_all_env(pTHX_ SV *sv, MAGIC *mg)
cur += len+1;
}
FreeEnvironmentStrings(envv);
-# else
-# ifdef CYGWIN
+# else
+# ifdef CYGWIN
I32 i;
for (i = 0; environ[i]; i++)
Safefree(environ[i]);
-# else
-# ifndef PERL_USE_SAFE_PUTENV
+# else
+# ifndef PERL_USE_SAFE_PUTENV
I32 i;
if (environ == PL_origenviron)
@@ -848,12 +851,13 @@ Perl_magic_clear_all_env(pTHX_ SV *sv, MAGIC *mg)
else
for (i = 0; environ[i]; i++)
safesysfree(environ[i]);
-# endif /* PERL_USE_SAFE_PUTENV */
-# endif /* CYGWIN */
+# endif /* PERL_USE_SAFE_PUTENV */
+# endif /* CYGWIN */
environ[0] = Nullch;
-# endif /* WIN32 */
+# endif /* WIN32 */
+# endif /* PERL_IMPLICIT_SYS */
#endif /* VMS */
return 0;
}
@@ -1178,7 +1182,7 @@ Perl_magic_setdbline(pTHX_ SV *sv, MAGIC *mg)
i = SvTRUE(sv);
svp = av_fetch(GvAV(gv),
atoi(MgPV(mg,n_a)), FALSE);
- if (svp && SvIOKp(*svp) && (o = (OP*)SvSTASH(*svp)))
+ if (svp && SvIOKp(*svp) && (o = (OP*)SvIVX(*svp)))
o->op_private = i;
else if (ckWARN_d(WARN_INTERNAL))
Perl_warner(aTHX_ WARN_INTERNAL, "Can't break at that line\n");
@@ -1660,7 +1664,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
case '.':
if (PL_localizing) {
if (PL_localizing == 1)
- save_sptr((SV**)&PL_last_in_gv);
+ SAVESPTR(PL_last_in_gv);
}
else if (SvOK(sv) && GvIO(PL_last_in_gv))
IoLINES(GvIOp(PL_last_in_gv)) = (long)SvIV(sv);