cvs: php4 /ext/standard dir.c
| From: | Zak Greant | Date: | Sun, 30 Dec 2001 10:13:08 +0000 |
| Subject: | cvs: php4 /ext/standard dir.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-8861@lists.php.net to get a copy of this message | ||
zak Sun Dec 30 05:13:08 2001 EDT
Modified files:
/php4/ext/standard dir.c
Log:
chdir: corrected proto, converted to zend_parse_parameters
Index: php4/ext/standard/dir.c
diff -u php4/ext/standard/dir.c:1.82 php4/ext/standard/dir.c:1.83
--- php4/ext/standard/dir.c:1.82 Sun Dec 30 04:50:41 2001
+++ php4/ext/standard/dir.c Sun Dec 30 05:13:08 2001
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dir.c,v 1.82 2001/12/30 09:50:41 zak Exp $ */
+/* $Id: dir.c,v 1.83 2001/12/30 10:13:08 zak Exp $ */
/* {{{ includes/startup/misc */
@@ -253,23 +253,22 @@
/* }}} */
#endif
-/* {{{ proto int chdir(string directory)
+/* {{{ proto bool chdir(string directory)
Change the current directory */
PHP_FUNCTION(chdir)
{
- pval **arg;
- int ret;
+ char *str;
+ int ret, str_len;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) {
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) ==
FAILURE) {
+ RETURN_FALSE;
}
- convert_to_string_ex(arg);
- if (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(arg), NULL, CHECKUID_ALLOW_ONLY_FILE)) {
+ if (PG(safe_mode) && !php_checkuid(str, NULL, CHECKUID_ALLOW_ONLY_FILE)) {
RETURN_FALSE;
}
- ret = VCWD_CHDIR(Z_STRVAL_PP(arg));
+ ret = VCWD_CHDIR(str);
if (ret != 0) {
php_error(E_WARNING, "ChDir: %s (errno %d)", strerror(errno), errno);