]> granicus.if.org Git - php/commitdiff
Pass eof
authorMarcus Boerger <helly@php.net>
Thu, 13 Nov 2003 07:53:15 +0000 (07:53 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 13 Nov 2003 07:53:15 +0000 (07:53 +0000)
ext/dba/dba.c

index 31ce4827ef72fd28b5327ba7dc62ec7d4b5c998d..44deb75af8b399d711eeb3e470f8e68dbf58df00 100644 (file)
@@ -911,15 +911,24 @@ PHP_FUNCTION(dba_fetch)
 }
 /* }}} */
 
-/* {{{ proto array dba_key_split(string key)
-   Splits an inifile key into an array of the form array(0=>group,1=>value_name) */
+/* {{{ proto array|false dba_key_split(string key)
+   Splits an inifile key into an array of the form array(0=>group,1=>value_name) but returns false if input is false or null */
 PHP_FUNCTION(dba_key_split)
 {
+       zval *zkey;
        char *key, *name;
        int key_len;
-       
+
+       if (ZEND_NUM_ARGS() != 1) {
+               WRONG_PARAM_COUNT;
+       }
+       if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &zkey) == SUCCESS) {
+               if (Z_TYPE_P(zkey) == IS_NULL || (Z_TYPE_P(zkey) == IS_BOOL && !Z_LVAL_P(zkey))) {
+                       RETURN_BOOL(0);
+               }
+       }
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &key, &key_len) == FAILURE) {
-               return;
+               RETURN_BOOL(0);
        }
        array_init(return_value);
        if (key[0] == '[' && (name = strchr(key, ']')) != NULL) {