[PHP4BETA] CVS update: php4/ext/standard
| From: | andrey | Date: | Wed, 26 May 1999 18:45:54 +0000 |
| Subject: | [PHP4BETA] CVS update: php4/ext/standard | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-1083@lists.php.net to get a copy of this message | ||
Date: Wednesday May 26, 1999 @ 14:45
Author: andrey
Update of /repository/php4/ext/standard
In directory php:/tmp/cvs-serv7901/ext/standard
Modified Files:
reg.c
Log Message:
Fixing a couple of long standing bugs.
Index: php4/ext/standard/reg.c
diff -u php4/ext/standard/reg.c:1.9 php4/ext/standard/reg.c:1.10
--- php4/ext/standard/reg.c:1.9 Fri May 21 03:04:48 1999
+++ php4/ext/standard/reg.c Wed May 26 14:45:53 1999
@@ -28,7 +28,7 @@
| Jaakko Hyvätti <jaakko@hyvatti.iki.fi> |
+----------------------------------------------------------------------+
*/
-/* $Id: reg.c,v 1.9 1999/05/21 07:04:48 sas Exp $ */
+/* $Id: reg.c,v 1.10 1999/05/26 18:45:53 andrey Exp $ */
#include <stdio.h>
#include "php.h"
@@ -563,7 +563,7 @@
}
/* churn through str, generating array entries as we go */
- while ((count == -1 || count > 1) && !(err = regexec(&re, strp, 1, subs, 0))) {
+ while ((count == -1 || count > 0) && !(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,9 +604,11 @@
}
/* otherwise we just have one last element to add to the array */
- size = endp - strp;
+ if (count == -1) {
+ size = endp - strp;
- add_next_index_stringl(return_value, strp, size, 1);
+ add_next_index_stringl(return_value, strp, size, 1);
+ }
regfree(&re);
--
PHP 4 Beta