[PHP4BETA] CVS update: php4/ext/pcre
| From: | andrey | Date: | Sun, 30 May 1999 14:48:39 +0000 |
| Subject: | [PHP4BETA] CVS update: php4/ext/pcre | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-1205@lists.php.net to get a copy of this message | ||
Date: Sunday May 30, 1999 @ 10:48
Author: andrey
Update of /repository/php4/ext/pcre
In directory php:/tmp/cvs-serv27458
Modified Files:
pcre.c
Log Message:
preg_match_all() now returns the number of global matches.
Index: php4/ext/pcre/pcre.c
diff -u php4/ext/pcre/pcre.c:1.12 php4/ext/pcre/pcre.c:1.13
--- php4/ext/pcre/pcre.c:1.12 Sat May 29 16:45:00 1999
+++ php4/ext/pcre/pcre.c Sun May 30 10:48:39 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pcre.c,v 1.12 1999/05/29 20:45:00 andrey Exp $ */
+/* $Id: pcre.c,v 1.13 1999/05/30 14:48:39 andrey Exp $ */
#include "php.h"
@@ -380,6 +380,7 @@
piece = subject->value.str.val;
subject_end = piece + subject->value.str.len;
match = NULL;
+ matched = 0;
do {
/* Execute the regular expression. */
@@ -396,7 +397,7 @@
/* If something has matched */
if (count >= 0) {
- matched = 1;
+ matched++;
match = piece + offsets[0];
/* If subpatters array has been passed, fill it in with values. */
@@ -444,10 +445,6 @@
/* Advance to the position right after the last full match */
piece += offsets[1];
}
- }
- /* If nothing matched */
- else {
- matched = 0;
}
} while (global && count >= 0);
--
PHP 4 Beta