From: Jarkko Hietaniemi Date: Fri, 23 Feb 2001 02:05:46 +0000 (+0000) Subject: A better workaround for Borland putenv() brokenness from Sarathy. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=19341a787be644444063ba4f751fe735e4a581cb;p=p5sagit%2Fp5-mst-13.2.git A better workaround for Borland putenv() brokenness from Sarathy. p4raw-id: //depot/perl@8909 --- diff --git a/perl.c b/perl.c index b90dea9..23b1a4d 100644 --- a/perl.c +++ b/perl.c @@ -3384,21 +3384,12 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register *s = '='; #if defined(__BORLANDC__) && defined(USE_WIN32_RTL_ENV) /* Sins of the RTL. See note in my_setenv(). */ - { /* Turn this into Perl_my_putenv()? */ - char *putenvp = savepv(*env); - - if (putenvp) { - char *p = putenvp; - - while (*p && *p != '=') p++; - if (p == '=') { - *p++ = 0; - my_setenv(putenvp, p); - } - - Safefree(putenvp); - } /* else what? */ - } + { + STRLEN len = strlen(*env); + char *e = safesysmalloc(len+1); + (void)strcpy(e, *env); + (void)PerlEnv_putenv(e); + } #endif } #ifdef NEED_ENVIRON_DUP_FOR_MODIFY