*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.67 2000/11/14 19:13:27 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.68 2000/11/25 04:38:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
seq++;
/* divide into multiple syslog() calls if message is too long */
- if (len > PG_SYSLOG_LIMIT)
+ /* or if the message contains embedded NewLine(s) '\n' */
+ if (len > PG_SYSLOG_LIMIT || strchr(line,'\n') != NULL )
{
static char buf[PG_SYSLOG_LIMIT+1];
int chunk_nr = 0;
{
int l;
int i;
+ /* if we start at a newline, move ahead one char */
+ if (line[0] == '\n')
+ {
+ line++;
+ len--;
+ }
strncpy(buf, line, PG_SYSLOG_LIMIT);
buf[PG_SYSLOG_LIMIT] = '\0';
+ if (strchr(buf,'\n') != NULL)
+ *strchr(buf,'\n') = '\0';
l = strlen(buf);
#ifdef MULTIBYTE