cvs: php4 /ext/standard basic_functions.c

From: Date: Sun, 30 Dec 2001 09:36:30 +0000
Subject: cvs: php4 /ext/standard basic_functions.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-8858@lists.php.net to get a copy of this message
zak Sun Dec 30 04:36:30 2001 EDT Modified files: /php4/ext/standard basic_functions.c Log: Converted getenv to use zend_parse_parameters Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.432 php4/ext/standard/basic_functions.c:1.433 --- php4/ext/standard/basic_functions.c:1.432 Sat Dec 29 17:59:40 2001 +++ php4/ext/standard/basic_functions.c Sun Dec 30 04:36:24 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.432 2001/12/29 22:59:40 derick Exp $ */ +/* $Id: basic_functions.c,v 1.433 2001/12/30 09:36:24 zak Exp $ */ #include "php.h" #include "php_main.h" @@ -1178,21 +1178,15 @@ Get the value of an environment variable */ PHP_FUNCTION(getenv) { - pval **str; - char *ptr; + char *ptr, *str; + int str_len; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { - WRONG_PARAM_COUNT; - } - convert_to_string_ex(str); - - if (Z_TYPE_PP(str) != IS_STRING) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { RETURN_FALSE; } - - ptr = sapi_getenv(Z_STRVAL_PP(str), Z_STRLEN_PP(str) TSRMLS_CC); - if (!ptr) { - ptr = getenv(Z_STRVAL_PP(str)); + ptr = sapi_getenv(str, str_len TSRMLS_CC); + if (! ptr) { + ptr = getenv(str); } if (ptr) { RETURN_STRING(ptr, 1);

« previous php.cvs (#8858) next »