summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-10-30 23:39:14 +0000
committerZeev Suraski <zeev@php.net>2000-10-30 23:39:14 +0000
commit78194a47b7ad76aaea3bb8e91fa0f5707ae88d00 (patch)
treefe0a66d9f67176d1cce99994d09770141827c428 /ext
parent4171da016ce465832d32196e3b8eed014c073704 (diff)
downloadphp-git-78194a47b7ad76aaea3bb8e91fa0f5707ae88d00.tar.gz
- Complete the move to the new INI parser. (Side effect: at last, people
can finally have spaces and tabs in their extension statements...)
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/basic_functions.c5
-rw-r--r--ext/standard/browscap.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 1477cbbc20..a952c8576a 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -2402,14 +2402,15 @@ PHP_FUNCTION(parse_ini_file)
}
convert_to_string_ex(filename);
- fh.handle.fp = V_FOPEN((*filename)->value.str.val, "r");
+ fh.handle.fp = V_FOPEN(Z_STRVAL_PP(filename), "r");
if (!fh.handle.fp) {
php_error(E_WARNING,"Cannot open '%s' for reading", (*filename)->value.str.val);
return;
}
fh.type = ZEND_HANDLE_FP;
+ fh.filename = Z_STRVAL_PP(filename);
array_init(return_value);
- zend_parse_ini_file(&fh, ini_parser_cb, return_value);
+ zend_parse_ini_file(&fh, 0, ini_parser_cb, return_value);
}
/* }}} */
diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c
index 6ca27c6c11..fcbe8e5116 100644
--- a/ext/standard/browscap.c
+++ b/ext/standard/browscap.c
@@ -33,7 +33,7 @@ static zval *current_section;
static void browscap_entry_dtor(zval *pvalue)
{
- if (pvalue->type == IS_OBJECT || pvalue->type == IS_ARRAY) {
+ if (pvalue->type == IS_OBJECT) {
zend_hash_destroy(pvalue->value.obj.properties);
free(pvalue->value.obj.properties);
}
@@ -144,7 +144,8 @@ PHP_MINIT_FUNCTION(browscap)
php_error(E_WARNING,"Cannot open '%s' for reading", browscap);
return FAILURE;
}
- zend_parse_ini_file(&fh, (zend_ini_parser_cb_t) php_browscap_parser_cb, &browser_hash);
+ fh.filename = browscap;
+ zend_parse_ini_file(&fh, 1, (zend_ini_parser_cb_t) php_browscap_parser_cb, &browser_hash);
}
return SUCCESS;