#include <signal.h>
#include <sys/utsname.h>
+#include <lib-lua/lib-lua.h>
#include <lib-sys/exit.h>
#include <lib-sys/mutt_signal.h>
#include <lib-mime/mime.h>
*/
switch (count) {
case 0:
- snprintf (buf, sizeof (buf), "%s/.mime.types", NONULL (Homedir));
+ snprintf(buf, sizeof (buf), "%s/.mime.types", NONULL(MCore.homedir));
break;
case 1:
m_strcpy(buf, sizeof(buf), SYSCONFDIR "/madmutt-mime.types");
a->length = sb.st_size;
}
- fpout = m_tempfile(temp, sizeof(temp), NONULL(Tempdir), NULL);
+ fpout = m_tempfile(temp, sizeof(temp), NONULL(MCore.tmpdir), NULL);
if (!fpout) {
mutt_error(_("Could not create temporary file"));
goto cleanup;
a->noconv = 1;
a->force_charset = 1;
- s.fpout = m_tempfile(buff, sizeof(buff), NONULL(Tempdir), NULL);
+ s.fpout = m_tempfile(buff, sizeof(buff), NONULL(MCore.tmpdir), NULL);
if (!s.fpout) {
mutt_error(_("Could not create temporary file"));
return;
return (NULL);
}
- fp = m_tempfile(buffer, sizeof(buffer), NONULL(Tempdir), NULL);
+ fp = m_tempfile(buffer, sizeof(buffer), NONULL(MCore.tmpdir), NULL);
if (!fp)
return NULL;
os = (uname(&un) == -1) ? "UNIX" : un.sysname;
}
/* Add a vanity header */
- fprintf (fp, "User-Agent: %s (%s)\n", mutt_make_version (0), os);
+ fprintf (fp, "User-Agent: %s (%s)\n", mutt_make_version(), os);
}
return (ferror (fp) == 0 ? 0 : -1);
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), NONULL (Inews), nntp_format_str, 0, 0);
+ 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);
+ {
+ m_strcpy(cmd, sizeof(cmd), MTransport.sendmail);
+ }
- ps = s;
+ ps = cmd;
i = 0;
- while ((ps = strtok (ps, " "))) {
+ while ((ps = strtok(ps, " "))) {
if (argslen == argsmax)
p_realloc(&args, argsmax += 5);
args = add_args (args, &argslen, &argsmax, f);
}
}
- if (DsnNotify) {
+ if (MTransport.dsn_notify) {
args = add_option (args, &argslen, &argsmax, "-N");
- args = add_option (args, &argslen, &argsmax, DsnNotify);
+ args = add_option (args, &argslen, &argsmax, MTransport.dsn_notify);
}
- if (DsnReturn) {
+ if (MTransport.dsn_return) {
args = add_option (args, &argslen, &argsmax, "-R");
- args = add_option (args, &argslen, &argsmax, DsnReturn);
+ args = add_option (args, &argslen, &argsmax, MTransport.dsn_return);
}
args = add_option (args, &argslen, &argsmax, "--");
args = add_args (args, &argslen, &argsmax, to);
p_delete(&childout);
p_delete(&path);
- p_delete(&s);
p_delete(&args);
if (i == (EX_OK & 0xff))
if (!fp)
fp = msg->fp;
- f = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+ f = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
if (f) {
int ch_flags = CH_XMIT | CH_NONEWLINE | CH_NOQFROM;
* the message body begins with "From "
*/
if (f.magic == M_MMDF || f.magic == M_MBOX) {
- tempfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+ tempfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
if (!tempfp) {
mutt_error(_("Could not create temporary file"));
mx_close_mailbox (&f, NULL);