sniper Mon Jul 18 19:17:26 2005 EDT
Modified files:
/php-src/ext/standard reg.c
Log:
MFB4_4: Fix compile problem with --regex=system on some systems
http://cvs.php.net/diff.php/php-src/ext/standard/reg.c?r1=1.80&r2=1.81&ty=u
Index: php-src/ext/standard/reg.c
diff -u php-src/ext/standard/reg.c:1.80 php-src/ext/standard/reg.c:1.81
--- php-src/ext/standard/reg.c:1.80 Thu May 26 17:48:35 2005
+++ php-src/ext/standard/reg.c Mon Jul 18 19:17:24 2005
@@ -17,7 +17,7 @@
| Jaakko Hyvätti <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: reg.c,v 1.80 2005/05/26 21:48:35 andrei Exp $ */
+/* $Id: reg.c,v 1.81 2005/07/18 23:17:24 sniper Exp $ */
#include <stdio.h>
#include <ctype.h>
@@ -46,6 +46,7 @@
if(zend_hash_find(®(ht_rc), (char *) pattern, patlen+1, (void **)
&rc) == SUCCESS
&& rc->cflags == cflags) {
+#ifdef HAVE_REGEX_T_RE_MAGIC
/*
* We use a saved magic number to see whether cache is
corrupted, and if it
* is, we flush it and compile the pattern from scratch.
@@ -73,7 +74,20 @@
zend_hash_update(®(ht_rc), (char *) pattern, patlen+1,
(void *) &rcp, sizeof(rcp),
NULL);
}
-
+#else
+ memcpy(preg, &rc->preg, sizeof(*preg));
+ } else {
+ r = regcomp(preg, pattern, cflags);
+ if(!r) {
+ reg_cache rcp;
+
+ rcp.cflags = cflags;
+ memcpy(&rcp.preg, preg, sizeof(*preg));
+ zend_hash_update(®(ht_rc), (char *) pattern,
patlen+1,
+ (void *) &rcp,
sizeof(rcp), NULL);
+ }
+ }
+#endif
return r;
}
/* }}} */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php