Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/basic_functions.c branches/PHP_5_4/main/php_ini.c trunk/ext/standard/basic_functions.c

2011-09-26 Thread Pierre Joye
yes, another commit has been done at the same time by mistake, I added
a comment about that in the respective bug report.

Cheers,

On Mon, Sep 26, 2011 at 2:30 PM, Hannes Magnusson
 wrote:
> On Mon, Sep 26, 2011 at 10:49, Pierre Joye  wrote:
>> pajoye                                   Mon, 26 Sep 2011 08:49:28 +
>>
>> Revision: http://svn.php.net/viewvc?view=revision&revision=317306
>>
>> Log:
>> - be sure to check if the var ha not been removed between the two calls
>>
>> Changed paths:
>>    U   php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c
>>    U   php/php-src/branches/PHP_5_4/main/php_ini.c
>>    U   php/php-src/trunk/ext/standard/basic_functions.c
>>
>
> That was very weird commit..
> Are you sure you merged it between the branches right?
>
> -Hannes
>



-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/basic_functions.c branches/PHP_5_4/main/php_ini.c trunk/ext/standard/basic_functions.c

2011-09-26 Thread Hannes Magnusson
On Mon, Sep 26, 2011 at 10:49, Pierre Joye  wrote:
> pajoye                                   Mon, 26 Sep 2011 08:49:28 +
>
> Revision: http://svn.php.net/viewvc?view=revision&revision=317306
>
> Log:
> - be sure to check if the var ha not been removed between the two calls
>
> Changed paths:
>    U   php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c
>    U   php/php-src/branches/PHP_5_4/main/php_ini.c
>    U   php/php-src/trunk/ext/standard/basic_functions.c
>

That was very weird commit..
Are you sure you merged it between the branches right?

-Hannes

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/basic_functions.c branches/PHP_5_4/main/php_ini.c trunk/ext/standard/basic_functions.c

2011-09-26 Thread Pierre Joye
pajoye   Mon, 26 Sep 2011 08:49:28 +

Revision: http://svn.php.net/viewvc?view=revision&revision=317306

Log:
- be sure to check if the var ha not been removed between the two calls

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c
U   php/php-src/branches/PHP_5_4/main/php_ini.c
U   php/php-src/trunk/ext/standard/basic_functions.c

Modified: php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2011-09-26 
08:38:03 UTC (rev 317305)
+++ php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2011-09-26 
08:49:28 UTC (rev 317306)
@@ -4022,7 +4022,13 @@

ptr = emalloc(size);
size = GetEnvironmentVariableA(str, ptr, size);
-   RETURN_STRING(ptr, 0);
+   if (size == 0) {
+   /* has been removed between the two calls */
+   efree(ptr);
+   RETURN_EMPTY_STRING();
+   } else {
+   RETURN_STRING(ptr, 0);
+   }
}
 #else
/* system method returns a const */

Modified: php/php-src/branches/PHP_5_4/main/php_ini.c
===
--- php/php-src/branches/PHP_5_4/main/php_ini.c 2011-09-26 08:38:03 UTC (rev 
317305)
+++ php/php-src/branches/PHP_5_4/main/php_ini.c 2011-09-26 08:49:28 UTC (rev 
317306)
@@ -421,7 +421,11 @@
env_location = "";
} else {
size = GetEnvironmentVariableA("PHPRC", 
phprc_path, size);
-   env_location = phprc_path;
+   if (size == 0) {
+   env_location = "";
+   } else {
+   env_location = phprc_path;
+   }
}
}
}

Modified: php/php-src/trunk/ext/standard/basic_functions.c
===
--- php/php-src/trunk/ext/standard/basic_functions.c2011-09-26 08:38:03 UTC 
(rev 317305)
+++ php/php-src/trunk/ext/standard/basic_functions.c2011-09-26 08:49:28 UTC 
(rev 317306)
@@ -4024,7 +4024,13 @@

ptr = emalloc(size);
size = GetEnvironmentVariableA(str, ptr, size);
-   RETURN_STRING(ptr, 0);
+   if (size == 0) {
+   /* has been removed between the two calls */
+   efree(ptr);
+   RETURN_EMPTY_STRING();
+   } else {
+   RETURN_STRING(ptr, 0);
+   }
}
 #else
/* system method returns a const */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php