iliaa           Wed Jun 24 12:21:45 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.2&r2=1.34.2.1.2.10.2.3&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.2 
php-src/main/php_open_temporary_file.c:1.34.2.1.2.10.2.3
--- php-src/main/php_open_temporary_file.c:1.34.2.1.2.10.2.2    Wed Dec 31 
11:15:47 2008
+++ php-src/main/php_open_temporary_file.c      Wed Jun 24 12:21:45 2009
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_open_temporary_file.c,v 1.34.2.1.2.10.2.2 2008/12/31 11:15:47 
sebastian Exp $ */
+/* $Id: php_open_temporary_file.c,v 1.34.2.1.2.10.2.3 2009/06/24 12:21:45 
iliaa Exp $ */
 
 #include "php.h"
 
@@ -200,7 +200,14 @@
        {
                char* s = getenv("TMPDIR");
                if (s) {
-                       temporary_directory = strdup(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