/* sendmail-like interface to /bin/mail for system V,
- Copyright (C) 1985, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1994, 1999 Free Software Foundation, Inc.
This file is part of GNU Emacs.
Boston, MA 02111-1307, USA. */
+/* This is needed to get the declaration of cuserid in GNU libc. */
+#define _XOPEN_SOURCE 1
+
#define NO_SHORTNAMES
#include <../src/config.h>
-#if defined (BSD) && !defined (BSD4_1) && !defined (USE_FAKEMAIL)
+#if defined (BSD_SYSTEM) && !defined (BSD4_1) && !defined (USE_FAKEMAIL)
/* This program isnot used in BSD, so just avoid loader complaints. */
int
main ()
#undef static
#endif
-#ifdef read
-#undef read
-#undef write
-#undef open
-#undef close
-#endif
-
#ifdef WINDOWSNT
#include "ntlib.h"
#endif
#include <ctype.h>
#include <time.h>
#include <pwd.h>
+
+/* This is to declare cuserid. */
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
\f
/* Type definitions */
if (p == end)
{
linebuffer->size *= 2;
- buffer = ((char *) xrealloc (buffer, linebuffer->size));
+ buffer = ((char *) xrealloc ((long *)buffer, linebuffer->size));
p = buffer + (p - linebuffer->buffer);
end = buffer + linebuffer->size;
linebuffer->buffer = buffer;
{
static char keyword[KEYWORD_SIZE];
register char *ptr;
- register char c;
+ register int c;
ptr = &keyword[0];
- c = *field++;
+ c = (unsigned char) *field++;
if (isspace (c) || c == ':')
return ((char *) NULL);
*ptr++ = (islower (c) ? toupper (c) : c);
- while (((c = *field++) != ':') && ! isspace (c))
+ while (((c = (unsigned char) *field++) != ':') && ! isspace (c))
*ptr++ = (islower (c) ? toupper (c) : c);
*ptr++ = '\0';
while (isspace (c))
- c = *field++;
+ c = (unsigned char) *field++;
if (c != ':')
return ((char *) NULL);
*rest = field;
user_length = strlen (temp);
the_user = alloc_string (user_length + 1);
strcpy (the_user, temp);
- the_string = alloc_string (3 + prefix_length +
- user_length +
- date_length);
+ the_string = alloc_string (3 + prefix_length
+ + user_length
+ + date_length);
temp = the_string;
strcpy (temp, FROM_PREFIX);
temp = &temp[prefix_length];
Also, if the header has any FCC fields, call setup_files for each one. */
+void
parse_header (the_header, where)
header the_header;
register char *where;