cvs commit
| From: | andrey | Date: | Mon, 05 Jul 1999 11:25:51 +0000 |
| Subject: | cvs commit | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-1900@lists.php.net to get a copy of this message | ||
From: andrey
Date: Mon Jul 5 11:25:51 1999
Modified files:
php4/ext/pcre/pcre.c
php4/ext/pcre/php_pcre.h
Log message:
Correct option caching
Index: php4/ext/pcre/pcre.c
diff -u php4/ext/pcre/pcre.c:1.20 php4/ext/pcre/pcre.c:1.21
--- php4/ext/pcre/pcre.c:1.20 Tue Jun 22 10:56:32 1999
+++ php4/ext/pcre/pcre.c Mon Jul 5 11:25:51 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pcre.c,v 1.20 1999/06/22 14:56:32 andrey Exp $ */
+/* $Id: pcre.c,v 1.21 1999/07/05 15:25:51 andrey Exp $ */
#include "php.h"
@@ -169,6 +169,7 @@
char *pattern;
int regex_len;
int do_study = 0;
+ int poptions = 0;
pcre_cache_entry *pce;
pcre_cache_entry new_entry;
PCRE_LS_FETCH();
@@ -178,6 +179,7 @@
regex_len = strlen(regex);
if (zend_hash_find(&PCRE_G(pcre_cache), regex, regex_len+1, (void **)&pce) == SUCCESS) {
extra = pce->extra;
+ *preg_options = pce->preg_options;
return pce->re;
}
@@ -240,7 +242,7 @@
case 'X': coptions |= PCRE_EXTRA; break;
/* Custom preg options */
- case 'e': *preg_options |= PREG_REPLACE_EVAL; break;
+ case 'e': poptions |= PREG_REPLACE_EVAL; break;
case ' ':
case '\n':
@@ -275,11 +277,14 @@
}
}
+ *preg_options = poptions;
+
efree(pattern);
/* Store the compiled pattern and extra info in the cache. */
new_entry.re = re;
new_entry.extra = extra;
+ new_entry.preg_options = poptions;
zend_hash_update(&PCRE_G(pcre_cache), regex, regex_len+1, (void *)&new_entry,
sizeof(pcre_cache_entry), NULL);
Index: php4/ext/pcre/php_pcre.h
diff -u php4/ext/pcre/php_pcre.h:1.9 php4/ext/pcre/php_pcre.h:1.10
--- php4/ext/pcre/php_pcre.h:1.9 Thu Jun 10 10:41:37 1999
+++ php4/ext/pcre/php_pcre.h Mon Jul 5 11:25:51 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pcre.h,v 1.9 1999/06/10 14:41:37 andrey Exp $ */
+/* $Id: php_pcre.h,v 1.10 1999/07/05 15:25:51 andrey Exp $ */
#ifndef _PHP_PCRE_H
#define _PHP_PCRE_H
@@ -54,6 +54,7 @@
typedef struct {
pcre *re;
pcre_extra *extra;
+ int preg_options;
} pcre_cache_entry;
typedef struct {