ok, now let's try it _with_ attachments ..
!
----- Original Message -----
From: "Steph" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 23, 2003 10:27 PM
Subject: [PHP-DEV] small patch (fixes #19613)


> It took 180 times longer to test this than it did to fix it ..
>
> Please can someone check the test file, I'm not sure what the protocol
> is when the expected results are different on win32 and *nix.  (or
what
> SHLIB_SUFFIX macos uses, come to that!)
>
>


------------------------------------------------------------------------
--------


> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
--- current_basic_functions.c   2003-07-23 22:18:26.000000000 +0000
+++ basic_functions.c   2003-07-23 22:19:10.000000000 +0000
@@ -1335,14 +1335,16 @@
        convert_to_string_ex(str);
 
        if (Z_STRVAL_PP(str) && *(Z_STRVAL_PP(str))) {
-               char *p, **env;
+               char *p = NULL, **env;
                putenv_entry pe;
 
                pe.putenv_string = estrndup(Z_STRVAL_PP(str), Z_STRLEN_PP(str));
                pe.key = estrndup(Z_STRVAL_PP(str), Z_STRLEN_PP(str));
+               #ifndef PHP_WIN32
                if ((p = strchr(pe.key, '='))) {        /* nullify the '=' if there is 
one */
                        *p = '\0';
                }
+               #endif
                pe.key_len = strlen(pe.key);
 
                if (PG(safe_mode)) {
--TEST--
Bug #19613 (putenv("VAR=") does not empty VAR on win32)
--FILE--
<?php

function test_system_env($test) {

        var_dump($test);

        if(PHP_SHLIB_SUFFIX == 'dll') {
                system("echo %TEST%");
        }
        else {
                system("echo $TEST");
                }
        }

putenv("TEST=result");
$test = getenv("TEST");
test_system_env($test);

putenv("TEST=");
$test = getenv("TEST");
test_system_env($test);

?>
--EXPECT--
(on win32)
string(6) "result"
result
bool(false)
ECHO is on

(on *nix)
string(6) "result"
result
string(0)


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to