}
#endif
-#if !defined(OS2) && !defined(AMIGAOS) && !defined(_WIN32)
+#if !defined(OS2) && !defined(AMIGAOS) && !defined(WIN32)
/* And you'll never guess what the dog had */
/* in its mouth... */
if (tainting) {
}
}
}
-#endif /* neither OS2 nor AMIGAOS nor _WIN32 */
+#endif /* neither OS2 nor AMIGAOS nor WIN32 */
return 0;
}
}
int
-magic_clear_all_env()
+magic_clear_all_env(sv,mg)
+SV* sv;
+MAGIC* mg;
{
-#if defined(VMS) || defined(WIN32)
- DIE("'%ENV = @list;' is not implemented on this machine");
+#if defined(VMS)
+ die("Can't make list assignment to %%ENV on this system");
+#else
+#ifdef WIN32
+ char *envv = GetEnvironmentStrings();
+ char *cur = envv;
+ STRLEN len;
+ while (*cur) {
+ char *end = strchr(cur,'=');
+ if (end && end != cur) {
+ *end = '\0';
+ my_setenv(cur,Nullch);
+ *end = '=';
+ cur += strlen(end+1)+1;
+ }
+ else if ((len = strlen(cur)))
+ cur += len+1;
+ }
+ FreeEnvironmentStrings(envv);
#else
I32 i;
Safefree(environ[i]);
environ[0] = Nullch;
- return 0;
#endif
+#endif
+ return 0;
}
int
croak(no_aelem, (I32)LvTARGOFF(sv));
}
}
- SvREFCNT_inc(value);
+ (void)SvREFCNT_inc(value);
SvREFCNT_dec(LvTARG(sv));
LvTARG(sv) = value;
LvTARGLEN(sv) = 0;