X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=sendlib.c;h=4dfca681e6b6c8dd87d0e55759fb5b268a3dbb5e;hp=2c5611a629cc251d7dd534065299c4402bd6fc59;hb=f288d1771c814e6104da83e6f0f1761a40de1224;hpb=10b7c16c8905d1b7ceaeeb6cfab9ad2ec03d8780 diff --git a/sendlib.c b/sendlib.c index 2c5611a..4dfca68 100644 --- a/sendlib.c +++ b/sendlib.c @@ -9,32 +9,14 @@ #define _SENDLIB_C 1 -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include -#include -#include -#include -#include -#include -#include #include -#include -#include #include -#include -#include -#include -#include -#include - #include #include - #include - #include #include "mutt.h" @@ -1687,7 +1669,7 @@ static void mutt_gen_localpart(char *buf, unsigned int len, const char *fmt) #undef APPEND_FMT } -char *mutt_gen_msgid (void) +static char *mutt_gen_msgid (void) { char buf[SHORT_STRING]; char localpart[SHORT_STRING]; @@ -1750,17 +1732,8 @@ send_msg(const char *path, const char **args, const char *msg, char **tempfile) setsid (); /* next we close all open files */ -#if defined(OPEN_MAX) - for (fd = 0; fd < OPEN_MAX; fd++) - close (fd); -#elif defined(_POSIX_OPEN_MAX) - for (fd = 0; fd < _POSIX_OPEN_MAX; fd++) + for (fd = 0; fd < getdtablesize(); fd++) close (fd); -#else - close (0); - close (1); - close (2); -#endif /* now the second fork() */ if ((pid = fork ()) == 0) { @@ -2163,41 +2136,6 @@ int mutt_bounce_message (FILE * fp, HEADER * h, address_t * to) return ret; } - -/* given a list of addresses, return a list of unique addresses */ -address_t *mutt_remove_duplicates (address_t * addr) -{ - address_t *top = addr; - address_t **last = ⊤ - address_t *tmp; - int dodup = 0; - - while (addr) { - for (tmp = top; tmp && tmp != addr; tmp = tmp->next) { - if (tmp->mailbox && addr->mailbox && - !ascii_strcasecmp (addr->mailbox, tmp->mailbox)) { - dodup = 1; - break; - } - } - - if (dodup) { - *last = addr->next; - - addr->next = NULL; - address_list_wipe(&addr); - - addr = *last; - } - else { - last = &addr->next; - addr = addr->next; - } - } - - return (top); -} - static void set_noconv_flags (BODY * b, short flag) { for (; b; b = b->next) {