Mercurial > hg > xemacs-beta
diff lib-src/fakemail.c @ 396:6719134a07c2 r21-2-13
Import from CVS: tag r21-2-13
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:12:05 +0200 |
parents | cc15677e0335 |
children | 74fd4e045ea6 |
line wrap: on
line diff
--- a/lib-src/fakemail.c Mon Aug 13 11:11:38 2007 +0200 +++ b/lib-src/fakemail.c Mon Aug 13 11:12:05 2007 +0200 @@ -24,9 +24,9 @@ #include <../src/config.h> #if defined (BSD) && !defined (BSD4_1) && !defined (USE_FAKEMAIL) -/* This program isnot used in BSD, so just avoid loader complaints. */ +/* This program is not used in BSD, so just avoid loader complaints. */ int -main () +main (int argc, char *argv[]) { return 0; } @@ -34,7 +34,7 @@ #include <stdio.h> #include <stdlib.h> int -main () +main (int argc, char *argv[]) { /* Linux /bin/mail, if it exists, is NOT the Unix v7 mail that fakemail depends on! This causes garbled mail. Better to @@ -48,7 +48,7 @@ #else /* not BSD 4.2 (or newer) */ #ifdef MSDOS int -main () +main (int argc, char *argv[]) { return 0; } @@ -100,11 +100,11 @@ struct header_record *previous; }; typedef struct header_record *header; - + struct stream_record { FILE *handle; - int (*action)(); + int (*action)(FILE *); struct stream_record *rest_streams; }; typedef struct stream_record *stream_list; @@ -191,8 +191,7 @@ /* Like malloc but get fatal error if memory is exhausted. */ static char * -xmalloc (size) - size_t size; +xmalloc (size_t size) { char *result = malloc (((unsigned) size)); if (result == ((char *) NULL)) @@ -201,9 +200,7 @@ } static char * -xrealloc (ptr, size) - char *ptr; - size_t size; +xrealloc (char *ptr, size_t size) { char *result = realloc (ptr, ((unsigned) size)); if (result == ((char *) NULL)) @@ -221,7 +218,7 @@ } /* Read a line of text from `stream' into `linebuffer'. - * Return the length of the line. + * Return the length of the line. */ static long @@ -263,14 +260,17 @@ ptr = &keyword[0]; c = *field++; - if ((isspace (c)) || (c == ':')) - return ((char *) NULL); - *ptr++ = ((islower (c)) ? (toupper (c)) : c); - while (((c = *field++) != ':') && (!(isspace (c)))) - *ptr++ = ((islower (c)) ? (toupper (c)) : c); + if ((isspace ((int) (unsigned char) c)) || (c == ':')) + return (char *) NULL; + *ptr++ = ((islower ((int) (unsigned char) c)) ? + (toupper ((int) (unsigned char) c)) : c); + while (((c = *field++) != ':') && + (!(isspace ((int) (unsigned char) c)))) + *ptr++ = ((islower ((int) (unsigned char) c)) ? + (toupper ((int) (unsigned char) c)) : c); *ptr++ = '\0'; - while (isspace (c)) c = *field++; - if (c != ':') return ((char *) NULL); + while (isspace ((int) (unsigned char) c)) c = *field++; + if (c != ':') return (char *) NULL; *rest = field; return &keyword[0]; } @@ -371,7 +371,7 @@ } static void -add_a_stream (FILE *the_stream, int (*closing_action)()) +add_a_stream (FILE *the_stream, int (*closing_action)(FILE *)) { stream_list old = the_streams; the_streams = new_stream (); @@ -553,7 +553,7 @@ *where = '\0'; return; } - + static header read_header (void) { @@ -624,9 +624,7 @@ } int -main (argc, argv) - int argc; - char **argv; +main (int argc, char *argv[]) { char *command_line; header the_header; @@ -655,7 +653,7 @@ args_size (the_header))); strcpy (command_line, mail_program_name); parse_header (the_header, &command_line[name_length]); - + the_pipe = popen (command_line, "w"); if (the_pipe == ((FILE *) NULL)) fatal ("cannot open pipe to real mailer", (char *) 0);