summaryrefslogtreecommitdiff
path: root/ext/standard/reg.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-06-05 13:56:18 +0000
committerZeev Suraski <zeev@php.net>1999-06-05 13:56:18 +0000
commite586468a4e8e4906392dd99a302c39f623212321 (patch)
tree202833070c66448b3e2bc5b60b2618fa4a591237 /ext/standard/reg.c
parent92f986787b7099590c9f6b1982005fe4e8af7830 (diff)
downloadphp-git-e586468a4e8e4906392dd99a302c39f623212321.tar.gz
Not sure that's the right fix, but at least it fixes the symptom
Diffstat (limited to 'ext/standard/reg.c')
-rw-r--r--ext/standard/reg.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/standard/reg.c b/ext/standard/reg.c
index 8a7d97c9bb..6f5a08a981 100644
--- a/ext/standard/reg.c
+++ b/ext/standard/reg.c
@@ -564,6 +564,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))) {
+ printf("In the loop...\n");
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);
@@ -591,7 +592,9 @@ PHP_FUNCTION(split)
/* if we're only looking for a certain number of points,
stop looking once we hit it */
- if (count != -1) count--;
+ if (count != -1) {
+ count--;
+ }
}
/* see if we encountered an error */
@@ -604,7 +607,7 @@ PHP_FUNCTION(split)
}
/* otherwise we just have one last element to add to the array */
- if (count == -1) {
+ if (count == -1 || err==REG_NOMATCH) {
size = endp - strp;
add_next_index_stringl(return_value, strp, size, 1);