OP *o;
va_list args;
va_start(args, pat);
- o = do_die(aTHX_ pat, &args);
+ o = do_die(pat, &args);
va_end(args);
return o;
}
OP *o;
va_list args;
va_start(args, pat);
- o = do_die(aTHX_ pat, &args);
+ o = do_die(pat, &args);
va_end(args);
return o;
}
#endif /* PERL_USE_SAFE_PUTENV */
}
+#else /* WIN32 || CYGWIN32 */
+#if defined(CYGWIN32)
+/*
+ * Save environ of perl.exe, currently Cygwin links in separate environ's
+ * for each exe/dll. Probably should be a member of impure_ptr.
+ */
+static char ***Perl_main_environ;
+
+EXTERN_C void
+Perl_my_setenv_init(char ***penviron)
+{
+ Perl_main_environ = penviron;
+}
+
+void
+my_setenv(char *nam, char *val)
+{
+ /* You can not directly manipulate the environ[] array because
+ * the routines do some additional work that syncs the Cygwin
+ * environment with the Windows environment.
+ */
+ char *oldstr = environ[setenv_getix(nam)];
+
+ if (!val) {
+ if (!oldstr)
+ return;
+ unsetenv(nam);
+ Safefree(oldstr);
+ return;
+ }
+ setenv(nam, val, 1);
+ environ = *Perl_main_environ; /* environ realloc can occur in setenv */
+ if(oldstr && environ[setenv_getix(nam)] != oldstr)
+ Safefree(oldstr);
+}
#else /* if WIN32 */
void
}
#endif /* WIN32 */
+#endif
I32
Perl_setenv_getix(pTHX_ char *nam)
#endif
/* VMS' my_popen() is in VMS.c, same with OS/2. */
-#if (!defined(DOSISH) || defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS) && !defined(__OPEN_VM)
+#if (!defined(DOSISH) || defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS) && !defined(__OPEN_VM) && !defined(EPOC)
PerlIO *
Perl_my_popen(pTHX_ char *cmd, char *mode)
{
#endif /* !HAS_SIGACTION */
/* VMS' my_pclose() is in VMS.c; same with OS/2 */
-#if (!defined(DOSISH) || defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS) && !defined(__OPEN_VM)
+#if (!defined(DOSISH) || defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS) && !defined(__OPEN_VM) && !defined(EPOC)
I32
Perl_my_pclose(pTHX_ PerlIO *ptr)
{
}
double
-Perl_my_atof(const char* s) {
+Perl_my_atof(pTHX_ const char* s) {
#ifdef USE_LOCALE_NUMERIC
if ((PL_hints & HINT_LOCALE) && PL_numeric_local) {
double x, y;