cvs: php4 /ext/pcre php_pcre.c php_pcre.h
| From: | Andrei Zmievski | Date: | Tue, 12 Feb 2002 03:15:27 +0000 |
| Subject: | cvs: php4 /ext/pcre php_pcre.c php_pcre.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-9351@lists.php.net to get a copy of this message | ||
andrei Mon Feb 11 22:15:27 2002 EDT
Modified files:
/php4/ext/pcre php_pcre.c php_pcre.h
Log:
Fix a long-standing infelicity that resulted in extra regex information
not being passed to PCRE functions.
Index: php4/ext/pcre/php_pcre.c
diff -u php4/ext/pcre/php_pcre.c:1.117 php4/ext/pcre/php_pcre.c:1.118
--- php4/ext/pcre/php_pcre.c:1.117 Mon Feb 11 22:00:04 2002
+++ php4/ext/pcre/php_pcre.c Mon Feb 11 22:15:26 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pcre.c,v 1.117 2002/02/12 03:00:04 andrei Exp $ */
+/* $Id: php_pcre.c,v 1.118 2002/02/12 03:15:26 andrei Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -124,7 +124,7 @@
/* {{{ pcre_get_compiled_regex
*/
-PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *preg_options) {
+PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options) {
pcre *re = NULL;
int coptions = 0;
int soptions = 0;
@@ -153,7 +153,7 @@
#if HAVE_SETLOCALE
if (!strcmp(pce->locale, locale)) {
#endif
- extra = pce->extra;
+ *extra = pce->extra;
*preg_options = pce->preg_options;
return pce->re;
#if HAVE_SETLOCALE
@@ -283,7 +283,7 @@
/* If study option was specified, study the pattern and
store the result in extra for passing to pcre_exec. */
if (do_study) {
- extra = pcre_study(re, soptions, &error);
+ *extra = pcre_study(re, soptions, &error);
if (error != NULL) {
zend_error(E_WARNING, "Error while studying pattern");
}
@@ -295,7 +295,7 @@
/* Store the compiled pattern and extra info in the cache. */
new_entry.re = re;
- new_entry.extra = extra;
+ new_entry.extra = *extra;
new_entry.preg_options = poptions;
#if HAVE_SETLOCALE
new_entry.locale = locale;
@@ -383,7 +383,7 @@
}
/* Compile regex or get it from cache. */
- if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), extra, &preg_options)) == NULL) {
+ if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), &extra, &preg_options)) == NULL) {
RETURN_FALSE;
}
@@ -709,7 +709,7 @@
walk_last; /* Last walked character */
/* Compile regex or get it from cache. */
- if ((re = pcre_get_compiled_regex(regex, extra, &preg_options)) == NULL) {
+ if ((re = pcre_get_compiled_regex(regex, &extra, &preg_options)) == NULL) {
return NULL;
}
@@ -1110,7 +1110,7 @@
convert_to_string_ex(subject);
/* Compile regex or get it from cache. */
- if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), extra, &preg_options)) == NULL) {
+ if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), &extra, &preg_options)) == NULL) {
RETURN_FALSE;
}
@@ -1322,7 +1322,7 @@
}
/* Compile regex or get it from cache. */
- if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), extra, &preg_options)) == NULL) {
+ if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), &extra, &preg_options)) == NULL) {
RETURN_FALSE;
}
Index: php4/ext/pcre/php_pcre.h
diff -u php4/ext/pcre/php_pcre.h:1.30 php4/ext/pcre/php_pcre.h:1.31
--- php4/ext/pcre/php_pcre.h:1.30 Mon Feb 11 22:00:05 2002
+++ php4/ext/pcre/php_pcre.h Mon Feb 11 22:15:27 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pcre.h,v 1.30 2002/02/12 03:00:05 andrei Exp $ */
+/* $Id: php_pcre.h,v 1.31 2002/02/12 03:15:27 andrei Exp $ */
#ifndef PHP_PCRE_H
#define PHP_PCRE_H
@@ -42,7 +42,7 @@
PHP_FUNCTION(preg_grep);
PHPAPI char *php_pcre_replace(char *regex, int regex_len, char *subject, int subject_len, zval
*replace_val, int is_callable_replace, int *result_len, int limit TSRMLS_DC);
-PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *options);
+PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *options);
extern zend_module_entry pcre_module_entry;
#define pcre_module_ptr &pcre_module_entry