summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/sendmail/src/util.c')
-rw-r--r--contrib/sendmail/src/util.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/contrib/sendmail/src/util.c b/contrib/sendmail/src/util.c
index c11d085..e4a0530 100644
--- a/contrib/sendmail/src/util.c
+++ b/contrib/sendmail/src/util.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
@@ -13,7 +13,7 @@
#include <sendmail.h>
-SM_RCSID("@(#)$Id: util.c,v 8.357 2001/11/28 19:19:27 gshapiro Exp $")
+SM_RCSID("@(#)$Id: util.c,v 8.360 2002/04/04 21:32:15 gshapiro Exp $")
#include <sysexits.h>
#include <sm/xtrap.h>
@@ -905,6 +905,7 @@ putline(l, mci)
** PXLF_MAPFROM -- map From_ to >From_.
** PXLF_STRIP8BIT -- strip 8th bit.
** PXLF_HEADER -- map bare newline in header to newline space.
+** PXLF_NOADDEOL -- don't add an EOL if one wasn't present.
**
** Returns:
** none
@@ -938,10 +939,15 @@ putxline(l, len, mci, pxflags)
end = l + len;
do
{
+ bool noeol = false;
+
/* find the end of the line */
p = memchr(l, '\n', end - l);
if (p == NULL)
+ {
p = end;
+ noeol = true;
+ }
if (TrafficLogFile != NULL)
(void) sm_io_fprintf(TrafficLogFile, SM_TIME_DEFAULT,
@@ -1097,7 +1103,8 @@ putxline(l, len, mci, pxflags)
if (TrafficLogFile != NULL)
(void) sm_io_putc(TrafficLogFile, SM_TIME_DEFAULT,
'\n');
- if (sm_io_fputs(mci->mci_out, SM_TIME_DEFAULT,
+ if ((!bitset(PXLF_NOADDEOL, pxflags) || !noeol) &&
+ sm_io_fputs(mci->mci_out, SM_TIME_DEFAULT,
mci->mci_mailer->m_eol) == SM_IO_EOF)
break;
else
@@ -1711,7 +1718,7 @@ dumpfd(fd, printclosed, logit)
return;
}
- i = fcntl(fd, F_GETFL, NULL);
+ i = fcntl(fd, F_GETFL, 0);
if (i != -1)
{
(void) sm_snprintf(p, SPACELEFT(buf, p), "fl=0x%x, ", i);
OpenPOWER on IntegriCloud