]> granicus.if.org Git - php/commitdiff
Backing out changes.
authorAndrey Hristov <andrey@php.net>
Mon, 21 Jun 1999 23:07:46 +0000 (23:07 +0000)
committerAndrey Hristov <andrey@php.net>
Mon, 21 Jun 1999 23:07:46 +0000 (23:07 +0000)
ext/ereg/ereg.c
ext/standard/reg.c

index 72d3d53cffcc57657c53170cc11d6a71db1ab949..b01f659bdd148aa8bfc8e1877b2311ab2126ae75 100644 (file)
@@ -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);
 
index 72d3d53cffcc57657c53170cc11d6a71db1ab949..b01f659bdd148aa8bfc8e1877b2311ab2126ae75 100644 (file)
@@ -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);