summaryrefslogtreecommitdiff
path: root/ext/ereg
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2009-01-08 00:37:39 +0000
committerIlia Alshanetsky <iliaa@php.net>2009-01-08 00:37:39 +0000
commit9ce52853c78d4039b4fd728179c42f48f7429dd1 (patch)
tree922c447f959f361ae5e4a6827e8ec6c728c8ac3c /ext/ereg
parent93638ba661bd157bb5519169f6f3d022ad99a2d9 (diff)
downloadphp-git-9ce52853c78d4039b4fd728179c42f48f7429dd1.tar.gz
Simplify parameter parsing
Diffstat (limited to 'ext/ereg')
-rw-r--r--ext/ereg/ereg.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c
index 3df5f00ccc..ed9dfaec2b 100644
--- a/ext/ereg/ereg.c
+++ b/ext/ereg/ereg.c
@@ -578,22 +578,17 @@ PHP_FUNCTION(eregi_replace)
*/
static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
{
- long arg_count;
+ long count = -1;
regex_t re;
regmatch_t subs[1];
char *spliton, *str, *strp, *endp;
int spliton_len, str_len;
- int err, size, count = -1, copts = 0;
- int argc = ZEND_NUM_ARGS();
+ int err, size, copts = 0;
- if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &spliton, &spliton_len, &str, &str_len, &arg_count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &spliton, &spliton_len, &str, &str_len, &count) == FAILURE) {
return;
}
- if (argc > 2) {
- count = arg_count;
- }
-
if (icase) {
copts = REG_ICASE;
}