cvs: php4 /main/main.c [[Re: [PHP-DEV] ErrorLog problem]]
| From: | Jan Pavl�k | Date: | Sat, 30 Mar 2002 03:40:48 +0000 |
| Subject: | cvs: php4 /main/main.c [[Re: [PHP-DEV] ErrorLog problem]] | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-81943@lists.php.net to get a copy of this message | ||
rootshell Fri Mar 29 23:13:29 2002 CET
Modified files:
/php4/main/main.c
Log:
lot of same errors are logged as one, cleans errorlog
Index: php4/main/main.c
diff -u php4/main/main.c:1.404.2.5 php4/main/main.c:1.404.2.6
--- php4/main/main.c:1.404.2.5 Mon Dec 17 22:19:51 2001
+++ php4/main/main.c Fri Mar 29 23:11:03 2002
@@ -18,11 +18,12 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.404.2.5 2001/12/17 21:19:51 derick Exp $ */
+/* $Id: main.c,v 1.404.2.6 2002/03/29 23:10:05 rootshell Exp $ */
/* {{{ includes
*/
#include <stdio.h>
+#include <string.h>
#include "php.h"
#ifdef PHP_WIN32
#include "win32/time.h"
@@ -83,6 +84,9 @@
PHPAPI int core_globals_id;
#endif
+static char _err_buf[1024];
+#define MAX_ERR_LENGTH (buffer_len > sizeof(_err_buf) ? sizeof(_err_buf) :
buffer_len)
+
static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC);
@@ -417,6 +421,9 @@
char *append_string = INI_STR("error_append_string");
char *error_format;
+ if(!strncmp(buffer, _err_buf, MAX_ERR_LENGTH)) goto _away;
+ else strncpy(_err_buf, buffer, MAX_ERR_LENGTH);
+
error_format = PG(html_errors) ?
"<br>\n<b>%s</b>: %s in <b>%s</b> on line
<b>%d</b><br>\n"
: "\n%s: %s in %s on line %d\n";
@@ -437,6 +444,7 @@
if (append_string) {
PUTS(append_string);
}
+_away:
}
#if ZEND_DEBUG
{