projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove a mutt-ng thing that makes no sense at all.
[apps/madmutt.git]
/
sendlib.c
diff --git
a/sendlib.c
b/sendlib.c
index
cfb71cf
..
4c5219e
100644
(file)
--- a/
sendlib.c
+++ b/
sendlib.c
@@
-1308,31
+1308,22
@@
void mutt_write_address_list (address_t * adr, FILE * fp, int linelen,
fputc ('\n', fp);
}
fputc ('\n', fp);
}
-/* arbitrary number of elements to grow the array by */
-#define REF_INC 16
-
-#define TrimRef 10
-
/* need to write the list in reverse because they are stored in reverse order
* when parsed to speed up threading
*/
/* need to write the list in reverse because they are stored in reverse order
* when parsed to speed up threading
*/
-void mutt_write_references
(string_list_t * r, FILE *
f)
+void mutt_write_references
(string_list_t *r, FILE *
f)
{
{
- string_list_t **ref = NULL;
- int refcnt = 0, refmax = 0;
-
- for (; (TrimRef == 0 || refcnt < TrimRef) && r; r = r->next) {
- if (refcnt == refmax)
- p_realloc(&ref, refmax += REF_INC);
- ref[refcnt++] = r;
- }
+ string_list_t *refs[10];
+ int i;
- while (refcnt-- > 0) {
- f
putc (' ', f);
-
fputs (ref[refcnt]->data, f)
;
- }
+ p_clear(refs, countof(refs));
+ f
or (i = 0; i < countof(refs) && r; r = r->next) {
+
refs[i++] = r
;
+
}
- p_delete(&ref);
+ while (i-- > 0) {
+ fprintf(f, " %s", refs[i]->data);
+ }
}
static int edit_header(int mode, const char *s)
}
static int edit_header(int mode, const char *s)
@@
-1572,12
+1563,6
@@
const char *mutt_fqdn (short may_hide_host)
return p;
}
return p;
}
-/* normalized character (we're stricter than RFC2822, 3.6.4) */
-static char mutt_normalized_char(char c)
-{
- return (isalnum(c) || strchr(".!#$%&'*+-/=?^_`{|}~", c)) ? c : '.';
-}
-
static void mutt_gen_localpart(char *buf, unsigned int len, const char *fmt)
{
#define APPEND_FMT(fmt, arg) \
static void mutt_gen_localpart(char *buf, unsigned int len, const char *fmt)
{
#define APPEND_FMT(fmt, arg) \
@@
-1605,7
+1590,8
@@
static void mutt_gen_localpart(char *buf, unsigned int len, const char *fmt)
int c = *fmt++;
if (c != '%') {
int c = *fmt++;
if (c != '%') {
- APPEND_BYTE(mutt_normalized_char(c));
+ /* normalized character (we're stricter than RFC2822, 3.6.4) */
+ APPEND_BYTE((isalnum(c) || strchr(".!#$%&'*+-/=?^_`{|}~", c)) ? c : '.');
continue;
}
continue;
}
@@
-1657,7
+1643,6
@@
static void mutt_gen_localpart(char *buf, unsigned int len, const char *fmt)
break;
default: /* invalid formats are replaced by '.' */
APPEND_BYTE('.');
break;
default: /* invalid formats are replaced by '.' */
APPEND_BYTE('.');
- m_strncat(buf, len, ".", 1);
}
}
}
}
@@
-1669,16
+1654,16
@@
static void mutt_gen_localpart(char *buf, unsigned int len, const char *fmt)
static char *mutt_gen_msgid (void)
{
static char *mutt_gen_msgid (void)
{
- char buf[SHORT_STRING];
- char localpart[SHORT_STRING];
- const char *fqdn;
+
char buf[SHORT_STRING];
+
char localpart[SHORT_STRING];
+
const char *fqdn;
- if (!(fqdn = mutt_fqdn(0)))
- fqdn = NONULL(Hostname);
+
if (!(fqdn = mutt_fqdn(0)))
+
fqdn = NONULL(Hostname);
- mutt_gen_localpart(localpart, sizeof(localpart), MsgIdFormat);
- snprintf(buf, sizeof(buf), "<%s@%s>", localpart, fqdn);
- return m_strdup(buf);
+
mutt_gen_localpart(localpart, sizeof(localpart), MsgIdFormat);
+
snprintf(buf, sizeof(buf), "<%s@%s>", localpart, fqdn);
+
return m_strdup(buf);
}
static RETSIGTYPE alarm_handler (int sig __attribute__ ((unused)))
}
static RETSIGTYPE alarm_handler (int sig __attribute__ ((unused)))
@@
-1863,7
+1848,7
@@
static int mutt_invoke_sendmail (address_t * from, /* the sender */
mutt_FormatString (cmd, sizeof (cmd), NONULL (Inews), nntp_format_str, 0,
0);
mutt_FormatString (cmd, sizeof (cmd), NONULL (Inews), nntp_format_str, 0,
0);
- if (
!*cmd
) {
+ if (
m_strisempty(cmd)
) {
i = nntp_post (msg);
unlink (msg);
return i;
i = nntp_post (msg);
unlink (msg);
return i;
@@
-2232,11
+2217,9
@@
int mutt_write_fcc (const char *path, HEADER * hdr, const char *msgid,
fputc ('\n', msg->fp);
}
fputc ('\n', msg->fp);
}
-#ifdef MIXMASTER
/* (postponement) if the mail is to be sent through a mixmaster
* chain, save that information
*/
/* (postponement) if the mail is to be sent through a mixmaster
* chain, save that information
*/
-
if (post && hdr->chain && hdr->chain) {
string_list_t *p;
if (post && hdr->chain && hdr->chain) {
string_list_t *p;
@@
-2246,7
+2229,6
@@
int mutt_write_fcc (const char *path, HEADER * hdr, const char *msgid,
fputc ('\n', msg->fp);
}
fputc ('\n', msg->fp);
}
-#endif
if (tempfp) {
char sasha[LONG_STRING];
if (tempfp) {
char sasha[LONG_STRING];