]> granicus.if.org Git - php/commitdiff
fix handling VAR vs VAR= in putenv
authorAnatol Belski <ab@php.net>
Thu, 21 May 2015 06:19:54 +0000 (08:19 +0200)
committerAnatol Belski <ab@php.net>
Thu, 21 May 2015 06:19:54 +0000 (08:19 +0200)
using _putenv_s eliminates behavior diff in TS/NTS

ext/standard/basic_functions.c

index 98a5bb6db6ae06f24611491664236d098ecf0918..f8cb91ef8efdf76b1f43d0885e495c6bf3539975 100644 (file)
@@ -4148,7 +4148,7 @@ PHP_FUNCTION(putenv)
                Obviously the CRT version will be useful more often. But
                generally, doing both brings us on the safe track at least
                in NTS build. */
-       && _putenv(pe.putenv_string) == 0
+       && _putenv_s(pe.key, value ? value : "") == 0
 # endif
        ) { /* success */
 # endif