summaryrefslogtreecommitdiff
path: root/ext/standard/reg.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>1999-06-21 23:07:46 +0000
committerAndrey Hristov <andrey@php.net>1999-06-21 23:07:46 +0000
commit2b8c85bd0b2bd89f8004cfc7b53b23d03663aa57 (patch)
treeb7d0c8a90b89aeec3fee63090eab99ea110f79e3 /ext/standard/reg.c
parent80526676840d0861db8bb94fb3a6eaf8c30c8196 (diff)
downloadphp-git-2b8c85bd0b2bd89f8004cfc7b53b23d03663aa57.tar.gz
Backing out changes.
Diffstat (limited to 'ext/standard/reg.c')
-rw-r--r--ext/standard/reg.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/standard/reg.c b/ext/standard/reg.c
index 72d3d53cff..b01f659bdd 100644
--- a/ext/standard/reg.c
+++ b/ext/standard/reg.c
@@ -561,7 +561,7 @@ PHP_FUNCTION(split)
}
/* churn through str, generating array entries as we go */
- while ((count == -1 || count > 0) && !(err = regexec(&re, strp, 1, subs, 0))) {
+ while ((count == -1 || count > 1) && !(err = regexec(&re, strp, 1, subs, 0))) {
if (subs[0].rm_so == 0 && subs[0].rm_eo) {
/* match is at start of string, return empty string */
add_next_index_stringl(return_value, empty_string, 0, 1);
@@ -604,11 +604,9 @@ PHP_FUNCTION(split)
}
/* otherwise we just have one last element to add to the array */
- if (count == -1 || err==REG_NOMATCH) {
- size = endp - strp;
+ size = endp - strp;
- add_next_index_stringl(return_value, strp, size, 1);
- }
+ add_next_index_stringl(return_value, strp, size, 1);
regfree(&re);