From 2accf544cbd4bbe9df5f8990fbb80a98f6879086 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sun, 29 Mar 2015 13:18:25 +0200 Subject: [PATCH] ifdef win only api --- ext/standard/basic_functions.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index ae83ec79e7..7bf51eb5d5 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -3383,11 +3383,13 @@ static void php_putenv_destructor(zval *zv) /* {{{ */ putenv_entry *pe = Z_PTR_P(zv); if (pe->previous_value) { +# if defined(PHP_WIN32) /* MSVCRT has a bug in putenv() when setting a variable that * is already set; if the SetEnvironmentVariable() API call * fails, the Crt will double free() a string. * We try to avoid this by setting our own value first */ SetEnvironmentVariable(pe->key, "bugbug"); +# endif putenv(pe->previous_value); # if defined(PHP_WIN32) efree(pe->previous_value); -- 2.40.0