iliaa           Tue Jun 30 12:20:35 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/main       php_open_temporary_file.c 
  Log:
  
  MFB: Fixed bug #48465 (sys_get_temp_dir() possibly inconsistent when using
  TMPDIR).
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_open_temporary_file.c?r1=1.34.2.1.2.10.2.4&r2=1.34.2.1.2.10.2.5&diff_format=u
Index: php-src/main/php_open_temporary_file.c
diff -u php-src/main/php_open_temporary_file.c:1.34.2.1.2.10.2.4 
php-src/main/php_open_temporary_file.c:1.34.2.1.2.10.2.5
--- php-src/main/php_open_temporary_file.c:1.34.2.1.2.10.2.4    Wed Jun 24 
20:08:54 2009
+++ php-src/main/php_open_temporary_file.c      Tue Jun 30 12:20:35 2009
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_open_temporary_file.c,v 1.34.2.1.2.10.2.4 2009/06/24 20:08:54 
iliaa Exp $ */
+/* $Id: php_open_temporary_file.c,v 1.34.2.1.2.10.2.5 2009/06/30 12:20:35 
iliaa Exp $ */
 
 #include "php.h"
 
@@ -199,8 +199,15 @@
        /* On Unix use the (usual) TMPDIR environment variable. */
        {
                char* s = getenv("TMPDIR");
-               if (s) {
-                       temporary_directory = strdup(s);
+               if (s && *s) {
+                       int len = strlen(s);
+
+                       if (s[len - 1] == DEFAULT_SLASH) {
+                               temporary_directory = zend_strndup(s, len - 1);
+                       } else {
+                               temporary_directory = zend_strndup(s, len);
+                       }
+
                        return temporary_directory;
                }
        }



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

Reply via email to