X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/7c54442039a0a3cea312bd4d32259249fe8839e3..dddcbf00213d4f1c6866abfb8d9132636839a3a1:/lib-src/fakemail.c diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c index 93e14d7e96..588496a8ed 100644 --- a/lib-src/fakemail.c +++ b/lib-src/fakemail.c @@ -1,5 +1,5 @@ /* 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. @@ -19,20 +19,25 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 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. */ -void +int main () { + return 0; } #else /* not BSD 4.2 (or newer) */ #ifdef MSDOS -void +int main () { + return 0; } #else /* not MSDOS */ /* This conditional contains all the rest of the file. */ @@ -43,13 +48,6 @@ main () #undef static #endif -#ifdef read -#undef read -#undef write -#undef open -#undef close -#endif - #ifdef WINDOWSNT #include "ntlib.h" #endif @@ -59,6 +57,11 @@ main () #include #include #include + +/* This is to declare cuserid. */ +#ifdef HAVE_UNISTD_H +#include +#endif /* Type definitions */ @@ -221,7 +224,7 @@ readline (linebuffer, stream) 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; @@ -250,18 +253,18 @@ get_keyword (field, rest) { 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; @@ -366,9 +369,9 @@ make_file_preface () 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]; @@ -592,6 +595,7 @@ args_size (the_header) 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; @@ -695,7 +699,7 @@ write_header (the_header) return; } -void +int main (argc, argv) int argc; char **argv;