}
/* 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;
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;