helly           Thu Nov 13 02:53:16 2003 EDT

  Modified files:              
    /php-src/ext/dba    dba.c 
  Log:
  Pass eof
  
Index: php-src/ext/dba/dba.c
diff -u php-src/ext/dba/dba.c:1.101 php-src/ext/dba/dba.c:1.102
--- php-src/ext/dba/dba.c:1.101 Wed Nov 12 16:43:03 2003
+++ php-src/ext/dba/dba.c       Thu Nov 13 02:53:15 2003
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: dba.c,v 1.101 2003/11/12 21:43:03 helly Exp $ */
+/* $Id: dba.c,v 1.102 2003/11/13 07:53:15 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -911,15 +911,24 @@
 }
 /* }}} */
 
-/* {{{ 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) {

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

Reply via email to