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

2011-06-19 Thread Felipe Pena
felipe   Sun, 19 Jun 2011 14:50:44 +

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

Log:
- Opss, restore old behavior

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

Modified: php/php-src/branches/PHP_5_3/ext/standard/file.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/file.c2011-06-19 14:27:33 UTC 
(rev 312284)
+++ php/php-src/branches/PHP_5_3/ext/standard/file.c2011-06-19 14:50:44 UTC 
(rev 312285)
@@ -1499,15 +1499,15 @@
long arg1 = 0;
int oldumask;

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == 
FAILURE) {
-   RETURN_FALSE;
-   }
-
oldumask = umask(077);

if (BG(umask) == -1) {
BG(umask) = oldumask;
}
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == 
FAILURE) {
+   RETURN_FALSE;
+   }

if (ZEND_NUM_ARGS() == 0) {
umask(oldumask);

Modified: php/php-src/branches/PHP_5_4/ext/standard/file.c
===
--- php/php-src/branches/PHP_5_4/ext/standard/file.c2011-06-19 14:27:33 UTC 
(rev 312284)
+++ php/php-src/branches/PHP_5_4/ext/standard/file.c2011-06-19 14:50:44 UTC 
(rev 312285)
@@ -1414,15 +1414,15 @@
long arg1 = 0;
int oldumask;

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == 
FAILURE) {
-   RETURN_FALSE;
-   }
-
oldumask = umask(077);

if (BG(umask) == -1) {
BG(umask) = oldumask;
}
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == 
FAILURE) {
+   RETURN_FALSE;
+   }

if (ZEND_NUM_ARGS() == 0) {
umask(oldumask);

Modified: php/php-src/trunk/ext/standard/file.c
===
--- php/php-src/trunk/ext/standard/file.c   2011-06-19 14:27:33 UTC (rev 
312284)
+++ php/php-src/trunk/ext/standard/file.c   2011-06-19 14:50:44 UTC (rev 
312285)
@@ -1414,15 +1414,15 @@
long arg1 = 0;
int oldumask;

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == 
FAILURE) {
-   RETURN_FALSE;
-   }
-
oldumask = umask(077);

if (BG(umask) == -1) {
BG(umask) = oldumask;
}
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == 
FAILURE) {
+   RETURN_FALSE;
+   }

if (ZEND_NUM_ARGS() == 0) {
umask(oldumask);

-- 
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/file.c branches/PHP_5_4/ext/standard/file.c trunk/ext/standard/file.c

2011-06-19 Thread Felipe Pena
felipe   Sun, 19 Jun 2011 14:27:33 +

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

Log:
- Added missing void param check in sys_get_temp_dir
- Fixed param check of umask()

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

Modified: php/php-src/branches/PHP_5_3/ext/standard/file.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/file.c2011-06-19 13:39:50 UTC 
(rev 312283)
+++ php/php-src/branches/PHP_5_3/ext/standard/file.c2011-06-19 14:27:33 UTC 
(rev 312284)
@@ -1498,7 +1498,10 @@
 {
long arg1 = 0;
int oldumask;
-   int arg_count = ZEND_NUM_ARGS();
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == 
FAILURE) {
+   RETURN_FALSE;
+   }

oldumask = umask(077);

@@ -1506,12 +1509,9 @@
BG(umask) = oldumask;
}

-   if (arg_count == 0) {
+   if (ZEND_NUM_ARGS() == 0) {
umask(oldumask);
} else {
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", 
&arg1) == FAILURE) {
-   RETURN_FALSE;
-   }
umask(arg1);
}

@@ -2605,6 +2605,9 @@
Returns directory path used for temporary files */
 PHP_FUNCTION(sys_get_temp_dir)
 {
+   if (zend_parse_parameters_none() == FAILURE) {
+   return;
+   }
RETURN_STRING((char *)php_get_temporary_directory(), 1);
 }
 /* }}} */

Modified: php/php-src/branches/PHP_5_4/ext/standard/file.c
===
--- php/php-src/branches/PHP_5_4/ext/standard/file.c2011-06-19 13:39:50 UTC 
(rev 312283)
+++ php/php-src/branches/PHP_5_4/ext/standard/file.c2011-06-19 14:27:33 UTC 
(rev 312284)
@@ -1413,7 +1413,10 @@
 {
long arg1 = 0;
int oldumask;
-   int arg_count = ZEND_NUM_ARGS();
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == 
FAILURE) {
+   RETURN_FALSE;
+   }

oldumask = umask(077);

@@ -1421,12 +1424,9 @@
BG(umask) = oldumask;
}

-   if (arg_count == 0) {
+   if (ZEND_NUM_ARGS() == 0) {
umask(oldumask);
} else {
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", 
&arg1) == FAILURE) {
-   RETURN_FALSE;
-   }
umask(arg1);
}

@@ -2491,6 +2491,9 @@
Returns directory path used for temporary files */
 PHP_FUNCTION(sys_get_temp_dir)
 {
+   if (zend_parse_parameters_none() == FAILURE) {
+   return;
+   }
RETURN_STRING((char *)php_get_temporary_directory(), 1);
 }
 /* }}} */

Modified: php/php-src/trunk/ext/standard/file.c
===
--- php/php-src/trunk/ext/standard/file.c   2011-06-19 13:39:50 UTC (rev 
312283)
+++ php/php-src/trunk/ext/standard/file.c   2011-06-19 14:27:33 UTC (rev 
312284)
@@ -1413,7 +1413,10 @@
 {
long arg1 = 0;
int oldumask;
-   int arg_count = ZEND_NUM_ARGS();
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == 
FAILURE) {
+   RETURN_FALSE;
+   }

oldumask = umask(077);

@@ -1421,12 +1424,9 @@
BG(umask) = oldumask;
}

-   if (arg_count == 0) {
+   if (ZEND_NUM_ARGS() == 0) {
umask(oldumask);
} else {
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", 
&arg1) == FAILURE) {
-   RETURN_FALSE;
-   }
umask(arg1);
}

@@ -2491,6 +2491,9 @@
Returns directory path used for temporary files */
 PHP_FUNCTION(sys_get_temp_dir)
 {
+   if (zend_parse_parameters_none() == FAILURE) {
+   return;
+   }
RETURN_STRING((char *)php_get_temporary_directory(), 1);
 }
 /* }}} */

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