X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=sendlib.c;h=0a63e3454ce891c1c51527a2a7ed5b286e60504b;hp=73d41b3d43b62752877020eb2915b35e9b748df6;hb=3132c5f07ae687b5daac6b570347369967850863;hpb=fc7b90fd61ac9efd35a5b506cc10679969d84cba diff --git a/sendlib.c b/sendlib.c index 73d41b3..0a63e34 100644 --- a/sendlib.c +++ b/sendlib.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -1831,31 +1832,29 @@ static int mutt_invoke_sendmail (address_t * from, /* the sender */ const char *msg, /* file containing message */ int eightbit) { /* message contains 8bit chars */ - char *ps = NULL, *path = NULL, *s = NULL, *childout = NULL; + char cmd[LONG_STRING]; + char *ps = NULL, *path = NULL, *childout = NULL; const char **args = NULL; ssize_t argslen = 0, argsmax = 0; int i; #ifdef USE_NNTP if (option (OPTNEWSSEND)) { - char cmd[LONG_STRING]; - m_strformat(cmd, sizeof(cmd), 0, Inews, nntp_format_str, 0, 0); if (m_strisempty(cmd)) { i = nntp_post (msg); unlink (msg); return i; } - - s = m_strdup(cmd); - } - else + } else #endif - s = m_strdup(Sendmail); + { + mlua_value(cmd, sizeof(cmd), "madmutt", "sendmail"); + } - ps = s; + ps = cmd; i = 0; - while ((ps = strtok (ps, " "))) { + while ((ps = strtok(ps, " "))) { if (argslen == argsmax) p_realloc(&args, argsmax += 5); @@ -1930,7 +1929,6 @@ static int mutt_invoke_sendmail (address_t * from, /* the sender */ p_delete(&childout); p_delete(&path); - p_delete(&s); p_delete(&args); if (i == (EX_OK & 0xff))