CVS update: php3/functions
| From: | andrey | Date: | Thu, 27 May 1999 20:19:39 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-6096@lists.php.net to get a copy of this message | ||
Date: Thursday May 27, 1999 @ 16:19
Author: andrey
Update of /repository/php3/functions
In directory php:/tmp/cvs-serv10279/functions
Modified Files:
pcre.c php3_pcre.h
Log Message:
A few fixes to pcre_replace().
Index: php3/functions/pcre.c
diff -u php3/functions/pcre.c:1.2 php3/functions/pcre.c:1.3
--- php3/functions/pcre.c:1.2 Thu May 27 11:56:02 1999
+++ php3/functions/pcre.c Thu May 27 16:19:38 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pcre.c,v 1.2 1999/05/27 15:56:02 andrey Exp $ */
+/* $Id: pcre.c,v 1.3 1999/05/27 20:19:38 andrey Exp $ */
#include "php.h"
@@ -598,9 +598,7 @@
static char *_php_replace_in_subject(pval *regex, pval *replace, pval *subject)
{
- pval **regex_entry_ptr,
- *regex_entry,
- **replace_entry_ptr,
+ pval *regex_entry,
*replace_entry;
char *replace_value,
*subject_value,
@@ -608,7 +606,7 @@
/* Make sure we're dealing with strings. */
convert_to_string(subject);
-
+
/* If regex is an array */
if (regex->type == IS_ARRAY) {
/* Duplicating subject string for repeated replacement */
@@ -623,8 +621,7 @@
replace_value = replace->value.str.val;
/* For each entry in the regex array, get the entry */
- while (_php3_hash_get_current_data(regex->value.ht, (void **)®ex_entry_ptr) == SUCCESS)
{
- regex_entry = *regex_entry_ptr;
+ while (_php3_hash_get_current_data(regex->value.ht, (void **)®ex_entry) == SUCCESS) {
/* Make sure we're dealing with strings. */
convert_to_string(regex_entry);
@@ -632,8 +629,7 @@
/* If replace is an array */
if (replace->type == IS_ARRAY) {
/* Get current entry */
- if (_php3_hash_get_current_data(replace->value.ht, (void **)&replace_entry_ptr) ==
SUCCESS) {
- replace_entry = *replace_entry_ptr;
+ if (_php3_hash_get_current_data(replace->value.ht, (void **)&replace_entry) == SUCCESS)
{
/* Make sure we're dealing with strings. */
convert_to_string(replace_entry);
@@ -680,9 +676,7 @@
pval *regex,
*replace,
*subject,
- **subject_entry_ptr,
- *subject_entry,
- *return_entry;
+ *subject_entry;
char *result;
/* Get function parameters and do error-checking. */
@@ -697,9 +691,7 @@
/* For each subject entry, convert it to string, then perform replacement
and add the result to the return_value array. */
- while (_php3_hash_get_current_data(subject->value.ht, (void **)&subject_entry_ptr) ==
SUCCESS) {
- subject_entry = *subject_entry_ptr;
-
+ while (_php3_hash_get_current_data(subject->value.ht, (void **)&subject_entry) == SUCCESS)
{
if ((result = _php_replace_in_subject(regex, replace, subject_entry)) != NULL)
add_next_index_string(return_value, result, 0);
Index: php3/functions/php3_pcre.h
diff -u php3/functions/php3_pcre.h:1.1 php3/functions/php3_pcre.h:1.2
--- php3/functions/php3_pcre.h:1.1 Thu May 27 11:42:52 1999
+++ php3/functions/php3_pcre.h Thu May 27 16:19:38 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php3_pcre.h,v 1.1 1999/05/27 15:42:52 andrey Exp $ */
+/* $Id: php3_pcre.h,v 1.2 1999/05/27 20:19:38 andrey Exp $ */
#ifndef _PHP_PCRE_H
#define _PHP_PCRE_H
@@ -36,7 +36,12 @@
#include "modules.h"
#include "internal_functions.h"
+
+#if HAVE_BUNDLED_PCRE
+#include "pcrelib/pcre.h"
+#else
#include "pcre.h"
+#endif
extern void php_info_pcre(void);
extern int php_minit_pcre(INIT_FUNC_ARGS);
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net