VERSIONize.
[p5sagit/p5-mst-13.2.git] / perl.c
diff --git a/perl.c b/perl.c
index 292b56b..a8f6ceb 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -469,8 +469,10 @@ perl_destruct(pTHXx)
     }
 
     /* jettison our possibly duplicated environment */
-
-#ifdef USE_ENVIRON_ARRAY
+    /* if PERL_USE_SAFE_PUTENV is defined environ will not have been copied
+     * so we certainly shouldn't free it here
+     */
+#if defined(USE_ENVIRON_ARRAY) && !defined(PERL_USE_SAFE_PUTENV)
     if (environ != PL_origenviron) {
        I32 i;
 
@@ -2189,8 +2191,10 @@ Perl_moreswitches(pTHX_ char *s)
        return s;
     case 'F':
        PL_minus_F = TRUE;
-       PL_splitstr = savepv(s + 1);
-       s += strlen(s);
+       PL_splitstr = ++s;
+       while (*s && !isSPACE(*s)) ++s;
+       *s = '\0';
+       PL_splitstr = savepv(PL_splitstr);
        return s;
     case 'a':
        PL_minus_a = TRUE;
@@ -2269,7 +2273,7 @@ Perl_moreswitches(pTHX_ char *s)
                s++;
        }
        return s;
-    case 'I':  /* -I handled both here and in parse_perl() */
+    case 'I':  /* -I handled both here and in parse_body() */
        forbid_setid("-I");
        ++s;
        while (*s && isSPACE(*s))
@@ -3436,7 +3440,7 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register
        magicname("0", "0", 1);
 #endif
     }
-    if ((tmpgv = gv_fetchpv("\030",TRUE, SVt_PV)))
+    if ((tmpgv = gv_fetchpv("\030",TRUE, SVt_PV))) /* $^X */
 #ifdef OS2
        sv_setpv(GvSV(tmpgv), os2_execname(aTHX));
 #else