This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
More MPE/iX tweaks from Mark Bixby.
[perl5.git] / perl.c
diff --git a/perl.c b/perl.c
index 2e39794..5951e22 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -149,7 +149,6 @@ void
 perl_construct(pTHXx)
 {
 #ifdef USE_THREADS
-    int i;
 #ifndef FAKE_THREADS
     struct perl_thread *thr = NULL;
 #endif /* FAKE_THREADS */
@@ -817,14 +816,24 @@ perl_free(pTHXx)
 #if defined(PERL_OBJECT)
     PerlMem_free(this);
 #else
-#  if defined(WIN32)
+#  if defined(WIN32) || defined(NETWARE)
 #  if defined(PERL_IMPLICIT_SYS)
-    void *host = w32_internal_host;
-    if (PerlProc_lasthost()) {
+    #ifdef NETWARE
+               void *host = nw_internal_host;
+       #else
+               void *host = w32_internal_host;
+       #endif
+       #ifndef NETWARE
+       if (PerlProc_lasthost()) {
        PerlIO_cleanup();
-    }
+       }
+       #endif
     PerlMem_free(aTHXx);
-    win32_delete_internal_host(host);
+       #ifdef NETWARE
+               nw5_delete_internal_host(host);
+       #else
+               win32_delete_internal_host(host);
+       #endif
 #else
     PerlIO_cleanup();
     PerlMem_free(aTHXx);
@@ -965,7 +974,7 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
     AV* comppadlist;
     register SV *sv;
     register char *s;
-    char *cddir = Nullch;
+    char *popts, *cddir = Nullch;
 
     sv_setpvn(PL_linestr,"",0);
     sv = newSVpvn("",0);               /* first used for -I flags */
@@ -1190,8 +1199,9 @@ print \"  \\@INC:\\n    @INC\\n\";");
 #ifndef SECURE_INTERNAL_GETENV
         !PL_tainting &&
 #endif
-       (s = PerlEnv_getenv("PERL5OPT")))
+       (popts = PerlEnv_getenv("PERL5OPT")))
     {
+       s = savepv(popts);
        while (isSPACE(*s))
            s++;
        if (*s == '-' && *(s+1) == 'T')
@@ -1296,6 +1306,7 @@ print \"  \\@INC:\\n    @INC\\n\";");
     av_store(comppadlist, 1, (SV*)PL_comppad);
     CvPADLIST(PL_compcv) = comppadlist;
 
+    boot_core_PerlIO();
     boot_core_UNIVERSAL();
 #ifndef PERL_MICRO
     boot_core_xsutils();
@@ -1680,7 +1691,7 @@ Perl_call_sv(pTHX_ SV *sv, I32 flags)
     LOGOP myop;                /* fake syntax tree node */
     UNOP method_op;
     I32 oldmark;
-    I32 retval;
+    volatile I32 retval = 0;
     I32 oldscope;
     bool oldcatch = CATCH_GET;
     int ret;
@@ -1867,8 +1878,8 @@ Perl_eval_sv(pTHX_ SV *sv, I32 flags)
 {
     dSP;
     UNOP myop;         /* fake syntax tree node */
-    I32 oldmark = SP - PL_stack_base;
-    I32 retval;
+    volatile I32 oldmark = SP - PL_stack_base;
+    volatile I32 retval = 0;
     I32 oldscope;
     int ret;
     OP* oldop = PL_op;
@@ -2343,7 +2354,7 @@ Perl_moreswitches(pTHX_ char *s)
 #endif
 #ifdef MPE
        PerlIO_printf(PerlIO_stdout(),
-                     "MPE/iX port Copyright by Mark Klein and Mark Bixby, 1996-1999\n");
+                     "MPE/iX port Copyright by Mark Klein and Mark Bixby, 1996-2001\n");
 #endif
 #ifdef OEMVS
        PerlIO_printf(PerlIO_stdout(),
@@ -3138,6 +3149,9 @@ S_find_beginning(pTHX)
                    while ((s = moreswitches(s)))
                        ;
            }
+#ifdef MACOS_TRADITIONAL
+           break;
+#endif
        }
     }
 }
@@ -3317,8 +3331,8 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register
     char *s;
     SV *sv;
     GV* tmpgv;
-    char **dup_env_base = 0;
 #ifdef NEED_ENVIRON_DUP_FOR_MODIFY
+    char **dup_env_base = 0;
     int dup_env_count = 0;
 #endif
 
@@ -3429,9 +3443,6 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register
        }
 #endif /* NEED_ENVIRON_DUP_FOR_MODIFY */
 #endif /* USE_ENVIRON_ARRAY */
-#ifdef DYNAMIC_ENV_FETCH
-       HvNAME(hv) = savepv(ENV_HV_NAME);
-#endif
     }
     TAINT_NOT;
     if ((tmpgv = gv_fetchpv("$",TRUE, SVt_PV)))