push username, homedir and tmpdir in lua too.
authorPierre Habouzit <madcoder@debian.org>
Sun, 18 Mar 2007 14:08:54 +0000 (15:08 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sun, 18 Mar 2007 14:08:54 +0000 (15:08 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
36 files changed:
account.c
alias.c
attach.c
browser.c
commands.c
globals.h
handler.c
headers.c
help.c
imap/imap.c
imap/message.c
init.c
init.h
lib-crypt/crypt-gpgme.c
lib-crypt/crypt.c
lib-crypt/pgp.c
lib-crypt/pgpkey.c
lib-crypt/pgpmicalg.c
lib-crypt/smime.c
lib-lua/lua-token.sh
lib-lua/madmutt.cpkg
lib-mime/rfc3676.c
lib-mx/compress.c
lib-mx/mbox.c
lib-mx/mx.c
lib-sys/mutt_ssl.c
main.c
muttlib.c
nntp/nntp.c
pattern.c
pop/pop.c
postpone.c
recvattach.c
recvcmd.c
send.c
sendlib.c

index 17234fb..ea1806a 100644 (file)
--- a/account.c
+++ b/account.c
@@ -19,8 +19,8 @@
 /* mutt_account_match: compare account info (host/port/user/login) */
 int mutt_account_match (const ACCOUNT * a1, const ACCOUNT * a2)
 {
 /* mutt_account_match: compare account info (host/port/user/login) */
 int mutt_account_match (const ACCOUNT * a1, const ACCOUNT * a2)
 {
-    const char* user = NONULL (Username);
-    const char* login = NONULL (Username);
+    const char* user  = NONULL(MCore.username);
+    const char* login = NONULL(MCore.username);
 
     if (a1->type != a2->type)
         return 0;
 
     if (a1->type != a2->type)
         return 0;
@@ -140,7 +140,7 @@ int mutt_account_getuser (ACCOUNT * account)
     /* prompt (defaults to unix username), copy into account->user */
     else {
         snprintf(prompt, sizeof(prompt), _("Username at %s: "), account->host);
     /* prompt (defaults to unix username), copy into account->user */
     else {
         snprintf(prompt, sizeof(prompt), _("Username at %s: "), account->host);
-        m_strcpy(account->user, sizeof(account->user), NONULL(Username));
+        m_strcpy(account->user, sizeof(account->user), NONULL(MCore.username));
         if (mutt_get_field_unbuffered(prompt, account->user,
                                       sizeof(account->user), 0))
             return -1;
         if (mutt_get_field_unbuffered(prompt, account->user,
                                       sizeof(account->user), 0))
             return -1;
diff --git a/alias.c b/alias.c
index f1021ef..03482c6 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -107,10 +107,10 @@ int mutt_addr_is_user(address_t *addr)
     if (!addr->mailbox)
         return 0;
 
     if (!addr->mailbox)
         return 0;
 
-    if (!ascii_strcasecmp(addr->mailbox, Username)
-    ||  string_is_address(addr->mailbox, Username, Hostname)
-    ||  string_is_address(addr->mailbox, Username, mutt_fqdn(0))
-    ||  string_is_address(addr->mailbox, Username, mutt_fqdn(1))
+    if (!ascii_strcasecmp(addr->mailbox, MCore.username)
+    ||  string_is_address(addr->mailbox, MCore.username, Hostname)
+    ||  string_is_address(addr->mailbox, MCore.username, mutt_fqdn(0))
+    ||  string_is_address(addr->mailbox, MCore.username, mutt_fqdn(1))
     ||  (From && !ascii_strcasecmp(From->mailbox, addr->mailbox)))
     {
         return 1;
     ||  (From && !ascii_strcasecmp(From->mailbox, addr->mailbox)))
     {
         return 1;
index 648d6db..d42e47a 100644 (file)
--- a/attach.c
+++ b/attach.c
@@ -138,7 +138,7 @@ int mutt_compose_attachment (BODY * a)
             /* Remove headers by copying out data to another file, then 
              * copying the file back */
             fseeko (fp, b->offset, 0);
             /* Remove headers by copying out data to another file, then 
              * copying the file back */
             fseeko (fp, b->offset, 0);
-            tfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+            tfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
             if (!tfp) {
               mutt_perror (_("Failure to open file to strip headers."));
               goto bailout;
             if (!tfp) {
               mutt_perror (_("Failure to open file to strip headers."));
               goto bailout;
@@ -440,7 +440,7 @@ int mutt_view_attachment (FILE * fp, BODY * a, int flag, HEADER * hdr,
 
   if (use_pager) {
     /* recv case */
 
   if (use_pager) {
     /* recv case */
-    pagerfd = m_tempfd(pagerfile, sizeof(pagerfile), NONULL(Tempdir),
+    pagerfd = m_tempfd(pagerfile, sizeof(pagerfile), NONULL(MCore.tmpdir),
                        fp && !use_mailcap ? a->filename : NULL);
   }
 
                        fp && !use_mailcap ? a->filename : NULL);
   }
 
@@ -923,7 +923,7 @@ int mutt_print_attachment (FILE * fp, BODY * a)
     ifp = NULL;
     fpout = NULL;
 
     ifp = NULL;
     fpout = NULL;
 
-    newfile_fd = m_tempfd(newfile, sizeof(newfile), NONULL(Tempdir), NULL);
+    newfile_fd = m_tempfd(newfile, sizeof(newfile), NONULL(MCore.tmpdir), NULL);
     if (mutt_decode_save_attachment (fp, a, newfile_fd, M_PRINTING) == 0) {
 
       if ((ifp = fopen(newfile, "r")) == NULL) {
     if (mutt_decode_save_attachment (fp, a, newfile_fd, M_PRINTING) == 0) {
 
       if ((ifp = fopen(newfile, "r")) == NULL) {
index fba0ac3..4a927d9 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -926,7 +926,7 @@ void _mutt_select_file (char *f, ssize_t flen, int flags, char ***files,
             /* try to restore the old values */
             m_strcpy(LastDir, sizeof(LastDir), OldLastDir);
             if (examine_directory (menu, &state, LastDir, prefix) == -1) {
             /* try to restore the old values */
             m_strcpy(LastDir, sizeof(LastDir), OldLastDir);
             if (examine_directory (menu, &state, LastDir, prefix) == -1) {
-              m_strcpy(LastDir, sizeof(LastDir), NONULL(Homedir));
+              m_strcpy(LastDir, sizeof(LastDir), NONULL(MCore.homedir));
               goto bail;
             }
           }
               goto bail;
             }
           }
index 8b5444b..c7fc7a5 100644 (file)
@@ -56,7 +56,7 @@ int mutt_display_message (HEADER * cur)
   mutt_parse_mime_message (Context, cur);
   mutt_message_hook (Context, cur, M_MESSAGEHOOK);
 
   mutt_parse_mime_message (Context, cur);
   mutt_message_hook (Context, cur, M_MESSAGEHOOK);
 
-  fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!fpout) {
     mutt_error _("Could not create temporary file!");
     return 0;
   if (!fpout) {
     mutt_error _("Could not create temporary file!");
     return 0;
index cf27213..5e4aa18 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -40,7 +40,6 @@ WHERE char *FolderFormat;
 WHERE char *ForwFmt;
 WHERE char *Fqdn;
 WHERE char *HdrFmt;
 WHERE char *ForwFmt;
 WHERE char *Fqdn;
 WHERE char *HdrFmt;
-WHERE char *Homedir;
 WHERE char *Hostname;
 
 WHERE char *ImapAuthenticators INITVAL (NULL);
 WHERE char *Hostname;
 
 WHERE char *ImapAuthenticators INITVAL (NULL);
@@ -146,10 +145,8 @@ WHERE char *SslCACertFile INITVAL (NULL);
 #endif
 WHERE char *StChars;
 WHERE char *Status;
 #endif
 WHERE char *StChars;
 WHERE char *Status;
-WHERE char *Tempdir;
 WHERE char *Tochars;
 WHERE char *TrashPath;
 WHERE char *Tochars;
 WHERE char *TrashPath;
-WHERE char *Username;
 WHERE char *XtermTitle;
 WHERE char *XtermLeave;
 WHERE char *XtermIcon;
 WHERE char *XtermTitle;
 WHERE char *XtermLeave;
 WHERE char *XtermIcon;
index c5c8301..0153bc3 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -1385,7 +1385,7 @@ int mutt_body_handler (BODY * b, STATE * s)
       if (!plaintext) {
         /* decode to a tempfile, saving the original destination */
         fp = s->fpout;
       if (!plaintext) {
         /* decode to a tempfile, saving the original destination */
         fp = s->fpout;
-        s->fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+        s->fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
         if (!s->fpout) {
           mutt_error _("Unable to open temporary file!");
           goto bail;
         if (!s->fpout) {
           mutt_error _("Unable to open temporary file!");
           goto bail;
index bd4f77e..cd3362b 100644 (file)
--- a/headers.c
+++ b/headers.c
@@ -28,7 +28,7 @@ void mutt_edit_headers(const char *body,
   struct stat st;
   string_list_t *cur, **last = NULL, *tmp;
 
   struct stat st;
   string_list_t *cur, **last = NULL, *tmp;
 
-  ofp = m_tempfile(path, sizeof(path), NONULL(Tempdir), NULL);
+  ofp = m_tempfile(path, sizeof(path), NONULL(MCore.tmpdir), NULL);
   if (!ofp) {
     mutt_perror (path);
     return;
   if (!ofp) {
     mutt_perror (path);
     return;
diff --git a/help.c b/help.c
index 1162b23..062f975 100644 (file)
--- a/help.c
+++ b/help.c
@@ -284,7 +284,7 @@ void mutt_help (int menu)
         desc = _("<UNKNOWN>");
 
     do {
         desc = _("<UNKNOWN>");
 
     do {
-        f = m_tempfile(tmp, sizeof(tmp), NONULL(Tempdir), NULL);
+        f = m_tempfile(tmp, sizeof(tmp), NONULL(MCore.tmpdir), NULL);
         if (!f) {
             mutt_perror(tmp);
             return;
         if (!f) {
             mutt_perror(tmp);
             return;
index e54b81f..6a84d94 100644 (file)
@@ -1600,7 +1600,7 @@ static int imap_open_new_message (MESSAGE * msg,
 {
     char tmp[_POSIX_PATH_MAX];
 
 {
     char tmp[_POSIX_PATH_MAX];
 
-    msg->fp = m_tempfile(tmp, sizeof(tmp), NONULL(Tempdir), NULL);
+    msg->fp = m_tempfile(tmp, sizeof(tmp), NONULL(MCore.tmpdir), NULL);
     if (!msg->fp) {
         mutt_perror(tmp);
         return -1;
     if (!msg->fp) {
         mutt_perror(tmp);
         return -1;
index a3225e4..3980496 100644 (file)
@@ -83,7 +83,7 @@ int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend)
 
   /* instead of downloading all headers and then parsing them, we parse them
    * as they come in. */
 
   /* instead of downloading all headers and then parsing them, we parse them
    * as they come in. */
-  fp = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  fp = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!fp) {
     mutt_error(_("Could not create temporary file"));
     mutt_sleep(2);
   if (!fp) {
     mutt_error(_("Could not create temporary file"));
     mutt_sleep(2);
@@ -376,7 +376,7 @@ int imap_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno)
     mutt_message _("Fetching message...");
 
   cache->uid = HEADER_DATA (h)->uid;
     mutt_message _("Fetching message...");
 
   cache->uid = HEADER_DATA (h)->uid;
-  msg->fp = m_tempfile(path, sizeof(path), NONULL(Tempdir), NULL);
+  msg->fp = m_tempfile(path, sizeof(path), NONULL(MCore.tmpdir), NULL);
   if (!msg->fp) {
     return -1;
   }
   if (!msg->fp) {
     return -1;
   }
diff --git a/init.c b/init.c
index 03065c2..96fcf0b 100644 (file)
--- a/init.c
+++ b/init.c
@@ -2209,37 +2209,13 @@ void mutt_init (int skip_sys_rc, string_list_t * commands)
   snprintf (AttachmentMarker, sizeof(AttachmentMarker),
             "\033]9;%ld\a", (long) time (NULL));
 
   snprintf (AttachmentMarker, sizeof(AttachmentMarker),
             "\033]9;%ld\a", (long) time (NULL));
 
-  /* on one of the systems I use, getcwd() does not return the same prefix
-     as is listed in the passwd file */
-  if ((p = getenv ("HOME")))
-    Homedir = m_strdup(p);
-
   /* Get some information about the user */
   if ((pw = getpwuid (getuid ()))) {
     char rnbuf[STRING];
   /* Get some information about the user */
   if ((pw = getpwuid (getuid ()))) {
     char rnbuf[STRING];
-
-    Username = m_strdup(pw->pw_name);
-    if (!Homedir)
-      Homedir = m_strdup(pw->pw_dir);
-
     mutt_gecos_name(rnbuf, sizeof(rnbuf), pw, GecosMask.rx);
     Realname = m_strdup(rnbuf);
     endpwent ();
   }
     mutt_gecos_name(rnbuf, sizeof(rnbuf), pw, GecosMask.rx);
     Realname = m_strdup(rnbuf);
     endpwent ();
   }
-  else {
-    if (!Homedir) {
-      mutt_endwin (NULL);
-      fputs (_("unable to determine home directory"), stderr);
-      exit (1);
-    }
-    if ((p = getenv ("USER")))
-      Username = m_strdup(p);
-    else {
-      mutt_endwin (NULL);
-      fputs (_("unable to determine username"), stderr);
-      exit (1);
-    }
-  }
 
   /* And about the host... */
   uname (&utsname);
 
   /* And about the host... */
   uname (&utsname);
@@ -2289,9 +2265,9 @@ void mutt_init (int skip_sys_rc, string_list_t * commands)
     Spoolfile = m_strdup(p);
   else {
 #ifdef HOMESPOOL
     Spoolfile = m_strdup(p);
   else {
 #ifdef HOMESPOOL
-    mutt_concat_path(buffer, sizeof(buffer), NONULL(Homedir), MAILPATH);
+    mutt_concat_path(buffer, sizeof(buffer), NONULL(MCore.homedir), MAILPATH);
 #else
 #else
-    mutt_concat_path(buffer, sizeof(buffer), MAILPATH, NONULL(Username));
+    mutt_concat_path(buffer, sizeof(buffer), MAILPATH, NONULL(MCore.username));
 #endif
     Spoolfile = m_strdup(buffer);
   }
 #endif
     Spoolfile = m_strdup(buffer);
   }
@@ -2305,8 +2281,6 @@ void mutt_init (int skip_sys_rc, string_list_t * commands)
                    "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap");
   }
 
                    "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap");
   }
 
-  Tempdir = m_strdup((p = getenv ("TMPDIR")) ? p : "/tmp");
-
   if ((p = getenv ("REPLYTO")) != NULL) {
     BUFFER buf, token;
 
   if ((p = getenv ("REPLYTO")) != NULL) {
     BUFFER buf, token;
 
@@ -2342,10 +2316,10 @@ void mutt_init (int skip_sys_rc, string_list_t * commands)
   mutt_init_history ();
 
   if (!Muttrc) {
   mutt_init_history ();
 
   if (!Muttrc) {
-      snprintf (buffer, sizeof(buffer), "%s/.madmuttrc", NONULL (Homedir));
+      snprintf (buffer, sizeof(buffer), "%s/.madmuttrc", NONULL(MCore.homedir));
     if (access (buffer, F_OK) == -1)
       snprintf (buffer, sizeof(buffer), "%s/.madmutt/madmuttrc",
     if (access (buffer, F_OK) == -1)
       snprintf (buffer, sizeof(buffer), "%s/.madmutt/madmuttrc",
-                NONULL (Homedir));
+                NONULL(MCore.homedir));
 
     default_rc = 1;
     Muttrc = m_strdup(buffer);
 
     default_rc = 1;
     Muttrc = m_strdup(buffer);
@@ -2398,9 +2372,9 @@ void mutt_init (int skip_sys_rc, string_list_t * commands)
   }
 
   /* LUA {{{ */
   }
 
   /* LUA {{{ */
-  snprintf(buffer, sizeof(buffer), "%s/.madmutt.lua", NONULL(Homedir));
+  snprintf(buffer, sizeof(buffer), "%s/.madmutt.lua", NONULL(MCore.homedir));
   if (access(buffer, F_OK) < 0)
   if (access(buffer, F_OK) < 0)
-      snprintf(buffer, sizeof(buffer), "%s/.madmutt/cfg.lua", NONULL(Homedir));
+      snprintf(buffer, sizeof(buffer), "%s/.madmutt/cfg.lua", NONULL(MCore.homedir));
   if (!access(buffer, F_OK)) {
       need_pause = luaM_wrap(mutt_error, luaM_dofile(buffer));
   }
   if (!access(buffer, F_OK)) {
       need_pause = luaM_wrap(mutt_error, luaM_dofile(buffer));
   }
diff --git a/init.h b/init.h
index fa5af82..1f706e6 100644 (file)
--- a/init.h
+++ b/init.h
@@ -3306,14 +3306,6 @@ struct option_t MuttVars[] = {
    ** checking for new mail.  A value of zero or less will cause Madmutt
    ** to never time out.
    */
    ** checking for new mail.  A value of zero or less will cause Madmutt
    ** to never time out.
    */
-  {"tmpdir", DT_PATH, R_NONE, UL &Tempdir, "" },
-  /*
-   ** .pp
-   ** This variable allows you to specify where Madmutt will place its
-   ** temporary files needed for displaying and composing messages.  If
-   ** this variable is not set, the environment variable \fT$$$TMPDIR\fP is
-   ** used.  If \fT$$$TMPDIR\fP is not set then "\fT/tmp\fP" is used.
-   */
   {"to_chars", DT_STR, R_BOTH, UL &Tochars, " +TCFL"},
   /*
    ** .pp
   {"to_chars", DT_STR, R_BOTH, UL &Tochars, " +TCFL"},
   /*
    ** .pp
index 445dc77..c0d4b7f 100644 (file)
@@ -348,7 +348,7 @@ static gpgme_data_t body_to_data_object (BODY * a, int convert)
   int err = 0;
   gpgme_data_t data;
 
   int err = 0;
   gpgme_data_t data;
 
-  fptmp = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  fptmp = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!fptmp) {
     mutt_perror (_("Can't create temporary file"));
     return NULL;
   if (!fptmp) {
     mutt_perror (_("Can't create temporary file"));
     return NULL;
@@ -454,7 +454,7 @@ static char *data_object_to_tempfile (gpgme_data_t data, FILE ** ret_fp)
   FILE *fp;
   ssize_t nread = 0;
 
   FILE *fp;
   ssize_t nread = 0;
 
-  fp = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  fp = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!fp) {
     mutt_perror (_("Can't create temporary file"));
     return NULL;
   if (!fp) {
     mutt_perror (_("Can't create temporary file"));
     return NULL;
@@ -1467,7 +1467,7 @@ int pgp_gpgme_decrypt_mime (FILE * fpin, FILE ** fpout, BODY * b, BODY ** cur)
 
   p_clear(&s, 1);
   s.fpin = fpin;
 
   p_clear(&s, 1);
   s.fpin = fpin;
-  *fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  *fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!*fpout) {
     mutt_perror (_("Can't create temporary file"));
     return -1;
   if (!*fpout) {
     mutt_perror (_("Can't create temporary file"));
     return -1;
@@ -1512,7 +1512,7 @@ int smime_gpgme_decrypt_mime (FILE * fpin, FILE ** fpout, BODY * b,
   p_clear(&s, 1);
   s.fpin = fpin;
   fseeko (s.fpin, b->offset, 0);
   p_clear(&s, 1);
   s.fpin = fpin;
   fseeko (s.fpin, b->offset, 0);
-  tmpfp = m_tempfile (tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  tmpfp = m_tempfile (tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!tmpfp) {
     mutt_perror (_("Can't create temporary file"));
     return -1;
   if (!tmpfp) {
     mutt_perror (_("Can't create temporary file"));
     return -1;
@@ -1529,7 +1529,7 @@ int smime_gpgme_decrypt_mime (FILE * fpin, FILE ** fpout, BODY * b,
   p_clear(&s, 1);
   s.fpin = tmpfp;
   s.fpout = 0;
   p_clear(&s, 1);
   s.fpin = tmpfp;
   s.fpout = 0;
-  *fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  *fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!*fpout) {
     mutt_perror (_("Can't create temporary file"));
     return -1;
   if (!*fpout) {
     mutt_perror (_("Can't create temporary file"));
     return -1;
@@ -1564,7 +1564,7 @@ int smime_gpgme_decrypt_mime (FILE * fpin, FILE ** fpout, BODY * b,
     p_clear(&s, 1);
     s.fpin = *fpout;
     fseeko (s.fpin, bb->offset, 0);
     p_clear(&s, 1);
     s.fpin = *fpout;
     fseeko (s.fpin, bb->offset, 0);
-    tmpfp = m_tempfile (tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+    tmpfp = m_tempfile (tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
     if (!tmpfp) {
       mutt_perror (_("Can't create temporary file"));
       return -1;
     if (!tmpfp) {
       mutt_perror (_("Can't create temporary file"));
       return -1;
@@ -1582,7 +1582,7 @@ int smime_gpgme_decrypt_mime (FILE * fpin, FILE ** fpout, BODY * b,
     p_clear(&s, 1);
     s.fpin = tmpfp;
     s.fpout = 0;
     p_clear(&s, 1);
     s.fpin = tmpfp;
     s.fpout = 0;
-    *fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+    *fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
     if (!*fpout) {
       mutt_perror (_("Can't create temporary file"));
       return -1;
     if (!*fpout) {
       mutt_perror (_("Can't create temporary file"));
       return -1;
@@ -1625,7 +1625,7 @@ static int pgp_check_traditional_one_body (FILE * fp, BODY * b,
   if (tagged_only && !b->tagged)
     return 0;
 
   if (tagged_only && !b->tagged)
     return 0;
 
-  tempfd = m_tempfd(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  tempfd = m_tempfd(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (mutt_decode_save_attachment (fp, b, tempfd, 0) != 0) {
     unlink (tempfile);
     return 0;
   if (mutt_decode_save_attachment (fp, b, tempfd, 0) != 0) {
     unlink (tempfile);
     return 0;
@@ -1994,7 +1994,7 @@ int pgp_gpgme_encrypted_handler (BODY * a, STATE * s)
   /* Move forward to the application/pgp-encrypted body. */
   a = a->next;
 
   /* Move forward to the application/pgp-encrypted body. */
   a = a->next;
 
-  fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!fpout) {
     if (s->flags & M_DISPLAY)
       state_attach_puts (_("[-- Error: could not create temporary file! "
   if (!fpout) {
     if (s->flags & M_DISPLAY)
       state_attach_puts (_("[-- Error: could not create temporary file! "
@@ -2054,7 +2054,7 @@ int smime_gpgme_application_handler (BODY * a, STATE * s)
   int rc = 0;
 
   a->warnsig = 0;
   int rc = 0;
 
   a->warnsig = 0;
-  fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!fpout) {
     if (s->flags & M_DISPLAY)
       state_attach_puts (_("[-- Error: could not create temporary file! "
   if (!fpout) {
     if (s->flags & M_DISPLAY)
       state_attach_puts (_("[-- Error: could not create temporary file! "
@@ -2925,7 +2925,7 @@ static void verify_key (crypt_key_t * key)
   gpgme_key_t k = NULL;
   int maxdepth = 100;
 
   gpgme_key_t k = NULL;
   int maxdepth = 100;
 
-  fp = m_tempfile (tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  fp = m_tempfile (tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!fp) {
     mutt_perror (_("Can't create temporary file"));
     return;
   if (!fp) {
     mutt_perror (_("Can't create temporary file"));
     return;
index 5f744ee..99728dc 100644 (file)
@@ -328,7 +328,7 @@ void crypt_extract_keys_from_messages (HEADER * h)
   address_t *tmp = NULL;
   FILE *fpout;
 
   address_t *tmp = NULL;
   FILE *fpout;
 
-  fpout = m_tempfile(tempfname, sizeof(tempfname), NONULL(Tempdir), NULL);
+  fpout = m_tempfile(tempfname, sizeof(tempfname), NONULL(MCore.tmpdir), NULL);
   if (!fpout) {
     mutt_error(_("Could not create temporary file"));
     return;
   if (!fpout) {
     mutt_error(_("Could not create temporary file"));
     return;
@@ -537,7 +537,7 @@ int mutt_signed_handler (BODY * a, STATE * s)
     crypt_fetch_signatures (&signatures, a->next, &sigcnt);
 
     if (sigcnt) {
     crypt_fetch_signatures (&signatures, a->next, &sigcnt);
 
     if (sigcnt) {
-      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"));
       } else {
       if (!tempfp) {
           mutt_error(_("Could not create temporary file"));
       } else {
index 297eb73..6b78ce4 100644 (file)
@@ -266,7 +266,7 @@ int pgp_application_pgp_handler (BODY * m, STATE * s)
       have_any_sigs = have_any_sigs || (clearsign && (s->flags & M_VERIFY));
 
       /* Copy PGP material to temporary file */
       have_any_sigs = have_any_sigs || (clearsign && (s->flags & M_VERIFY));
 
       /* Copy PGP material to temporary file */
-      tmpfp = m_tempfile(tmpfname, sizeof(tmpfname), NONULL(Tempdir), NULL);
+      tmpfp = m_tempfile(tmpfname, sizeof(tmpfname), NONULL(MCore.tmpdir), NULL);
       if (tmpfp == NULL) {
         mutt_perror (tmpfname);
         return (-1);
       if (tmpfp == NULL) {
         mutt_perror (tmpfname);
         return (-1);
@@ -295,7 +295,7 @@ int pgp_application_pgp_handler (BODY * m, STATE * s)
 
       /* Invoke PGP if needed */
       if (!clearsign || (s->flags & M_VERIFY)) {
 
       /* Invoke PGP if needed */
       if (!clearsign || (s->flags & M_VERIFY)) {
-        pgpout = m_tempfile(outfile, sizeof(outfile), NONULL(Tempdir), NULL);
+        pgpout = m_tempfile(outfile, sizeof(outfile), NONULL(MCore.tmpdir), NULL);
         if (pgpout == NULL) {
           mutt_perror (outfile);
           return (-1);
         if (pgpout == NULL) {
           mutt_perror (outfile);
           return (-1);
@@ -466,7 +466,7 @@ static int pgp_check_traditional_one_body (FILE * fp, BODY * b,
   if (tagged_only && !b->tagged)
     return 0;
 
   if (tagged_only && !b->tagged)
     return 0;
 
-  tempfd = m_tempfd(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  tempfd = m_tempfd(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (mutt_decode_save_attachment (fp, b, tempfd, 0) != 0) {
     unlink (tempfile);
     return 0;
   if (mutt_decode_save_attachment (fp, b, tempfd, 0) != 0) {
     unlink (tempfile);
     return 0;
@@ -548,7 +548,7 @@ int pgp_verify_one (BODY * sigbdy, STATE * s, const char *tempfile)
   mutt_copy_bytes (s->fpin, fp, sigbdy->length);
   m_fclose(&fp);
 
   mutt_copy_bytes (s->fpin, fp, sigbdy->length);
   m_fclose(&fp);
 
-  pgperr = m_tempfile(pgperrfile, sizeof(pgperrfile), NONULL(Tempdir), NULL);
+  pgperr = m_tempfile(pgperrfile, sizeof(pgperrfile), NONULL(MCore.tmpdir), NULL);
   if (pgperr == NULL) {
     mutt_perror (pgperrfile);
     unlink (sigfile);
   if (pgperr == NULL) {
     mutt_perror (pgperrfile);
     unlink (sigfile);
@@ -594,7 +594,7 @@ static void pgp_extract_keys_from_attachment (FILE * fp, BODY * top)
   FILE *tempfp;
   char tempfname[_POSIX_PATH_MAX];
 
   FILE *tempfp;
   char tempfname[_POSIX_PATH_MAX];
 
-  tempfp = m_tempfile(tempfname, sizeof(tempfname), NONULL(Tempdir), NULL);
+  tempfp = m_tempfile(tempfname, sizeof(tempfname), NONULL(MCore.tmpdir), NULL);
   if (tempfp == NULL) {
     mutt_perror (_("Can't create temporary file"));
     return;
   if (tempfp == NULL) {
     mutt_perror (_("Can't create temporary file"));
     return;
@@ -649,14 +649,14 @@ BODY *pgp_decrypt_part (BODY * a, STATE * s, FILE * fpout, BODY * p)
   pid_t thepid;
   int rv;
 
   pid_t thepid;
   int rv;
 
-  pgperr = m_tempfile(pgperrfile, sizeof(pgperrfile), NONULL(Tempdir), NULL);
+  pgperr = m_tempfile(pgperrfile, sizeof(pgperrfile), NONULL(MCore.tmpdir), NULL);
   if (!pgperr) {
     mutt_perror (pgperrfile);
     return NULL;
   }
   unlink (pgperrfile);
 
   if (!pgperr) {
     mutt_perror (pgperrfile);
     return NULL;
   }
   unlink (pgperrfile);
 
-  pgptmp = m_tempfile(pgptmpfile, sizeof(pgptmpfile), NONULL(Tempdir), NULL);
+  pgptmp = m_tempfile(pgptmpfile, sizeof(pgptmpfile), NONULL(MCore.tmpdir), NULL);
   if (!pgptmp) {
     mutt_perror (pgptmpfile);
     m_fclose(&pgperr);
   if (!pgptmp) {
     mutt_perror (pgptmpfile);
     m_fclose(&pgperr);
@@ -757,7 +757,7 @@ int pgp_decrypt_mime (FILE * fpin, FILE ** fpout, BODY * b, BODY ** cur)
 
   p_clear(&s, 1);
   s.fpin = fpin;
 
   p_clear(&s, 1);
   s.fpin = fpin;
-  *fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  *fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (*fpout == NULL) {
     mutt_perror (_("Can't create temporary file"));
     return (-1);
   if (*fpout == NULL) {
     mutt_perror (_("Can't create temporary file"));
     return (-1);
@@ -798,7 +798,7 @@ int pgp_encrypted_handler (BODY * a, STATE * s)
    */
   a = a->next;
 
    */
   a = a->next;
 
-  fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (fpout == NULL) {
     if (s->flags & M_DISPLAY)
       state_attach_puts (_
   if (fpout == NULL) {
     if (s->flags & M_DISPLAY)
       state_attach_puts (_
@@ -868,12 +868,12 @@ BODY *pgp_sign_message (BODY * a)
 
   convert_to_7bit (a);          /* Signed data _must_ be in 7-bit format. */
 
 
   convert_to_7bit (a);          /* Signed data _must_ be in 7-bit format. */
 
-  fp = m_tempfile(sigfile, sizeof(sigfile), NONULL(Tempdir), NULL);
+  fp = m_tempfile(sigfile, sizeof(sigfile), NONULL(MCore.tmpdir), NULL);
   if (fp == NULL) {
     return (NULL);
   }
 
   if (fp == NULL) {
     return (NULL);
   }
 
-  sfp = m_tempfile(signedfile, sizeof(signedfile), NONULL(Tempdir), NULL);
+  sfp = m_tempfile(signedfile, sizeof(signedfile), NONULL(MCore.tmpdir), NULL);
   if (sfp == NULL) {
     mutt_perror (signedfile);
     m_fclose(&fp);
   if (sfp == NULL) {
     mutt_perror (signedfile);
     m_fclose(&fp);
@@ -1112,13 +1112,13 @@ BODY *pgp_encrypt_message (BODY * a, char *keylist, int sign)
   int empty = 0;
   pid_t thepid;
 
   int empty = 0;
   pid_t thepid;
 
-  fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (fpout == NULL) {
     mutt_perror (_("Can't create temporary file"));
     return (NULL);
   }
 
   if (fpout == NULL) {
     mutt_perror (_("Can't create temporary file"));
     return (NULL);
   }
 
-  pgperr = m_tempfile(pgperrfile, sizeof(pgperrfile), NONULL(Tempdir), NULL);
+  pgperr = m_tempfile(pgperrfile, sizeof(pgperrfile), NONULL(MCore.tmpdir), NULL);
   if (pgperr == NULL) {
     mutt_perror (pgperrfile);
     m_fclose(&fpout);
   if (pgperr == NULL) {
     mutt_perror (pgperrfile);
     m_fclose(&fpout);
@@ -1127,7 +1127,7 @@ BODY *pgp_encrypt_message (BODY * a, char *keylist, int sign)
   }
   unlink (pgperrfile);
 
   }
   unlink (pgperrfile);
 
-  fptmp = m_tempfile(pgpinfile, sizeof(pgpinfile), NONULL(Tempdir), NULL);
+  fptmp = m_tempfile(pgpinfile, sizeof(pgpinfile), NONULL(MCore.tmpdir), NULL);
   if (fptmp == NULL) {
     mutt_perror (pgpinfile);
     m_fclose(&fpout);
   if (fptmp == NULL) {
     mutt_perror (pgpinfile);
     m_fclose(&fpout);
@@ -1251,7 +1251,7 @@ BODY *pgp_traditional_encryptsign (BODY * a, int flags, char *keylist)
     return NULL;
   }
 
     return NULL;
   }
 
-  pgpin = m_tempfile(pgpinfile, sizeof(pgpinfile), NONULL(Tempdir), NULL);
+  pgpin = m_tempfile(pgpinfile, sizeof(pgpinfile), NONULL(MCore.tmpdir), NULL);
   if (pgpin == NULL) {
     mutt_perror (pgpinfile);
     m_fclose(&fp);
   if (pgpin == NULL) {
     mutt_perror (pgpinfile);
     m_fclose(&fp);
@@ -1292,8 +1292,8 @@ BODY *pgp_traditional_encryptsign (BODY * a, int flags, char *keylist)
   m_fclose(&fp);
   m_fclose(&pgpin);
 
   m_fclose(&fp);
   m_fclose(&pgpin);
 
-  pgpout = m_tempfile(pgpoutfile, sizeof(pgpoutfile), NONULL(Tempdir), NULL);
-  pgperr = m_tempfile(pgperrfile, sizeof(pgperrfile), NONULL(Tempdir), NULL);
+  pgpout = m_tempfile(pgpoutfile, sizeof(pgpoutfile), NONULL(MCore.tmpdir), NULL);
+  pgperr = m_tempfile(pgperrfile, sizeof(pgperrfile), NONULL(MCore.tmpdir), NULL);
   if (pgpout == NULL || pgperr == NULL) {
     mutt_perror (pgpout ? pgperrfile : pgpoutfile);
     m_fclose(&pgpin);
   if (pgpout == NULL || pgperr == NULL) {
     mutt_perror (pgpout ? pgperrfile : pgpoutfile);
     m_fclose(&pgpin);
index 77c5d26..96db58a 100644 (file)
@@ -505,7 +505,7 @@ static pgp_key_t pgp_select_key (pgp_key_t keys, address_t * p, const char *s)
         break;
       }
 
         break;
       }
 
-      fp = m_tempfile (tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+      fp = m_tempfile (tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
       if (!fp) {
         m_fclose(&devnull);
         mutt_perror (_("Can't create temporary file"));
       if (!fp) {
         m_fclose(&devnull);
         mutt_perror (_("Can't create temporary file"));
@@ -682,7 +682,7 @@ BODY *pgp_make_key_attachment (char *tempf)
   pgp_free_key (&key);
 
   if (!tempf) {
   pgp_free_key (&key);
 
   if (!tempf) {
-    tempfp = m_tempfile (tempfb, sizeof(tempfb), NONULL(Tempdir), NULL);
+    tempfp = m_tempfile (tempfb, sizeof(tempfb), NONULL(MCore.tmpdir), NULL);
     tempf = tempfb;
   } else {
     tempfp = safe_fopen(tempf, "a");
     tempf = tempfb;
   } else {
     tempfp = safe_fopen(tempf, "a");
index ae16b11..0edbfea 100644 (file)
@@ -137,7 +137,7 @@ static short pgp_find_hash (const char *fname)
 
   short rv = -1;
 
 
   short rv = -1;
 
-  out = m_tempfile (tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  out = m_tempfile (tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!out) {
     mutt_perror (_("Can't create temporary file"));
     goto bye;
   if (!out) {
     mutt_perror (_("Can't create temporary file"));
     goto bye;
index 7e5690d..374f9f3 100644 (file)
@@ -771,14 +771,14 @@ static int smime_handle_cert_email (char *certificate, char *mailbox,
   int ret = -1, count = 0;
   pid_t thepid;
 
   int ret = -1, count = 0;
   pid_t thepid;
 
-  fperr = m_tempfile (tmpfname, sizeof(tmpfname), NONULL(Tempdir), NULL);
+  fperr = m_tempfile (tmpfname, sizeof(tmpfname), NONULL(MCore.tmpdir), NULL);
   if (!fperr) {
     mutt_perror (tmpfname);
     return 1;
   }
   mutt_unlink (tmpfname);
 
   if (!fperr) {
     mutt_perror (tmpfname);
     return 1;
   }
   mutt_unlink (tmpfname);
 
-  fpout = m_tempfile (tmpfname, sizeof(tmpfname), NONULL(Tempdir), NULL);
+  fpout = m_tempfile (tmpfname, sizeof(tmpfname), NONULL(MCore.tmpdir), NULL);
   if (!fpout) {
     m_fclose(&fperr);
     mutt_perror (tmpfname);
   if (!fpout) {
     m_fclose(&fperr);
     mutt_perror (tmpfname);
@@ -857,14 +857,14 @@ static char *smime_extract_certificate (char *infile)
   int empty;
 
 
   int empty;
 
 
-  fperr = m_tempfile (tmpfname, sizeof(tmpfname), NONULL(Tempdir), NULL);
+  fperr = m_tempfile (tmpfname, sizeof(tmpfname), NONULL(MCore.tmpdir), NULL);
   if (!fperr) {
     mutt_perror (tmpfname);
     return NULL;
   }
   mutt_unlink (tmpfname);
 
   if (!fperr) {
     mutt_perror (tmpfname);
     return NULL;
   }
   mutt_unlink (tmpfname);
 
-  fpout = m_tempfile (pk7out, sizeof(tmpfname), NONULL(Tempdir), NULL);
+  fpout = m_tempfile (pk7out, sizeof(tmpfname), NONULL(MCore.tmpdir), NULL);
   if (!fpout) {
     m_fclose(&fperr);
     mutt_perror (pk7out);
   if (!fpout) {
     m_fclose(&fperr);
     mutt_perror (pk7out);
@@ -906,7 +906,7 @@ static char *smime_extract_certificate (char *infile)
     return NULL;
   }
 
     return NULL;
   }
 
-  fpout = m_tempfile (certfile, sizeof(certfile), NONULL(Tempdir), NULL);
+  fpout = m_tempfile (certfile, sizeof(certfile), NONULL(MCore.tmpdir), NULL);
   if (!fpout) {
     m_fclose(&fperr);
     mutt_unlink (pk7out);
   if (!fpout) {
     m_fclose(&fperr);
     mutt_unlink (pk7out);
@@ -960,14 +960,14 @@ static char *smime_extract_signer_certificate (char *infile)
   pid_t thepid;
   int empty;
 
   pid_t thepid;
   int empty;
 
-  fperr = m_tempfile (tmpfname, sizeof(tmpfname), NONULL(Tempdir), NULL);
+  fperr = m_tempfile (tmpfname, sizeof(tmpfname), NONULL(MCore.tmpdir), NULL);
   if (!fperr) {
     mutt_perror (tmpfname);
     return NULL;
   }
   mutt_unlink (tmpfname);
 
   if (!fperr) {
     mutt_perror (tmpfname);
     return NULL;
   }
   mutt_unlink (tmpfname);
 
-  m_tempfile (certfile, sizeof(certfile), NONULL(Tempdir), NULL);
+  m_tempfile (certfile, sizeof(certfile), NONULL(MCore.tmpdir), NULL);
   if (!fpout) {
     m_fclose(&fperr);
     mutt_perror (certfile);
   if (!fpout) {
     m_fclose(&fperr);
     mutt_perror (certfile);
@@ -1020,14 +1020,14 @@ void smime_invoke_import (char *infile, char *mailbox __attribute__ ((unused)))
   FILE *smimein = NULL, *fpout = NULL, *fperr = NULL;
   pid_t thepid = -1;
 
   FILE *smimein = NULL, *fpout = NULL, *fperr = NULL;
   pid_t thepid = -1;
 
- fperr = m_tempfile (tmpfname, sizeof(tmpfname), NONULL(Tempdir), NULL);
+ fperr = m_tempfile (tmpfname, sizeof(tmpfname), NONULL(MCore.tmpdir), NULL);
   if (!fperr) {
     mutt_perror (tmpfname);
     return;
   }
   mutt_unlink (tmpfname);
 
   if (!fperr) {
     mutt_perror (tmpfname);
     return;
   }
   mutt_unlink (tmpfname);
 
-  fpout = m_tempfile (tmpfname, sizeof(tmpfname), NONULL(Tempdir), NULL);
+  fpout = m_tempfile (tmpfname, sizeof(tmpfname), NONULL(MCore.tmpdir), NULL);
   if (!fpout) {
     m_fclose(&fperr);
     mutt_perror (tmpfname);
   if (!fpout) {
     m_fclose(&fperr);
     mutt_perror (tmpfname);
@@ -1078,7 +1078,7 @@ int smime_verify_sender (HEADER * h)
   FILE *fpout;
   int retval = 1;
 
   FILE *fpout;
   int retval = 1;
 
-  fpout = m_tempfile (tempfname, sizeof(tempfname), NONULL(Tempdir), NULL);
+  fpout = m_tempfile (tempfname, sizeof(tempfname), NONULL(MCore.tmpdir), NULL);
   if (!fpout) {
     mutt_perror (_("Can't create temporary file"));
     return 1;
   if (!fpout) {
     mutt_perror (_("Can't create temporary file"));
     return 1;
@@ -1178,13 +1178,13 @@ BODY *smime_build_smime_entity (BODY * a, char *certlist)
   int err = 0, empty;
   pid_t thepid;
 
   int err = 0, empty;
   pid_t thepid;
 
-  fpout = m_tempfile (tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  fpout = m_tempfile (tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!fpout) {
     mutt_perror (_("Can't create temporary file"));
     return NULL;
   }
 
   if (!fpout) {
     mutt_perror (_("Can't create temporary file"));
     return NULL;
   }
 
-  smimeerr = m_tempfile (smimeerrfile, sizeof(smimeerrfile), NONULL(Tempdir), NULL);
+  smimeerr = m_tempfile (smimeerrfile, sizeof(smimeerrfile), NONULL(MCore.tmpdir), NULL);
   if (!smimeerr) {
     mutt_perror (smimeerrfile);
     m_fclose(&fpout);
   if (!smimeerr) {
     mutt_perror (smimeerrfile);
     m_fclose(&fpout);
@@ -1193,7 +1193,7 @@ BODY *smime_build_smime_entity (BODY * a, char *certlist)
   }
   mutt_unlink (smimeerrfile);
 
   }
   mutt_unlink (smimeerrfile);
 
-  fptmp = m_tempfile (smimeinfile, sizeof(smimeinfile), NONULL(Tempdir), NULL);
+  fptmp = m_tempfile (smimeinfile, sizeof(smimeinfile), NONULL(MCore.tmpdir), NULL);
   if (!fptmp) {
     mutt_perror (smimeinfile);
     mutt_unlink (tempfile);
   if (!fptmp) {
     mutt_perror (smimeinfile);
     mutt_unlink (tempfile);
@@ -1303,13 +1303,13 @@ BODY *smime_sign_message (BODY * a)
 
   convert_to_7bit (a);          /* Signed data _must_ be in 7-bit format. */
 
 
   convert_to_7bit (a);          /* Signed data _must_ be in 7-bit format. */
 
-  sfp = m_tempfile (filetosign, sizeof(filetosign), NONULL(Tempdir), NULL);
+  sfp = m_tempfile (filetosign, sizeof(filetosign), NONULL(MCore.tmpdir), NULL);
   if (!sfp) {
     mutt_perror (filetosign);
     return NULL;
   }
 
   if (!sfp) {
     mutt_perror (filetosign);
     return NULL;
   }
 
-  smimeout = m_tempfile (signedfile, sizeof(signedfile), NONULL(Tempdir), NULL);
+  smimeout = m_tempfile (signedfile, sizeof(signedfile), NONULL(MCore.tmpdir), NULL);
   if (!smimeout) {
     mutt_perror (signedfile);
     m_fclose(&sfp);
   if (!smimeout) {
     mutt_perror (signedfile);
     m_fclose(&sfp);
@@ -1492,7 +1492,7 @@ int smime_verify_one (BODY * sigbdy, STATE * s, const char *tempfile)
 
   sigbdy->type = origType;
 
 
   sigbdy->type = origType;
 
-  smimeerr = m_tempfile(smimeerrfile, sizeof(smimeerrfile), NONULL(Tempdir), NULL);
+  smimeerr = m_tempfile(smimeerrfile, sizeof(smimeerrfile), NONULL(MCore.tmpdir), NULL);
   if (!smimeerr) {
     mutt_perror (smimeerrfile);
     mutt_unlink (signedfile);
   if (!smimeerr) {
     mutt_perror (smimeerrfile);
     mutt_unlink (signedfile);
@@ -1573,13 +1573,13 @@ static BODY *smime_handle_entity (BODY * m, STATE * s, FILE * outFile)
   if (!(type & APPLICATION_SMIME))
     return NULL;
 
   if (!(type & APPLICATION_SMIME))
     return NULL;
 
-  smimeout = m_tempfile (outfile, sizeof(outfile), NONULL(Tempdir), NULL);
+  smimeout = m_tempfile (outfile, sizeof(outfile), NONULL(MCore.tmpdir), NULL);
   if (!smimeout) {
     mutt_perror (outfile);
     return NULL;
   }
 
   if (!smimeout) {
     mutt_perror (outfile);
     return NULL;
   }
 
-  smimeerr = m_tempfile(errfile, sizeof(errfile), NONULL(Tempdir), NULL);
+  smimeerr = m_tempfile(errfile, sizeof(errfile), NONULL(MCore.tmpdir), NULL);
   if (!smimeerr) {
     mutt_perror (errfile);
     m_fclose(&smimeout);
   if (!smimeerr) {
     mutt_perror (errfile);
     m_fclose(&smimeout);
@@ -1587,7 +1587,7 @@ static BODY *smime_handle_entity (BODY * m, STATE * s, FILE * outFile)
   }
   mutt_unlink (errfile);
 
   }
   mutt_unlink (errfile);
 
-  tmpfp = m_tempfile (tmpfname, sizeof(tmpfname), NONULL(Tempdir), NULL);
+  tmpfp = m_tempfile (tmpfname, sizeof(tmpfname), NONULL(MCore.tmpdir), NULL);
   if (!tmpfp) {
     mutt_perror (tmpfname);
     m_fclose(&smimeout);
   if (!tmpfp) {
     mutt_perror (tmpfname);
     m_fclose(&smimeout);
@@ -1663,7 +1663,7 @@ static BODY *smime_handle_entity (BODY * m, STATE * s, FILE * outFile)
     if (outFile)
       fpout = outFile;
     else {
     if (outFile)
       fpout = outFile;
     else {
-      fpout = m_tempfile (tmptmpfname, sizeof(tmptmpfname), NONULL(Tempdir), NULL);
+      fpout = m_tempfile (tmptmpfname, sizeof(tmptmpfname), NONULL(MCore.tmpdir), NULL);
       if (!fpout) {
         mutt_perror (tmptmpfname);
         m_fclose(&smimeout);
       if (!fpout) {
         mutt_perror (tmptmpfname);
         m_fclose(&smimeout);
@@ -1760,7 +1760,7 @@ int smime_decrypt_mime (FILE * fpin, FILE ** fpout, BODY * b, BODY ** cur)
   s.fpin = fpin;
   fseeko (s.fpin, b->offset, 0);
 
   s.fpin = fpin;
   fseeko (s.fpin, b->offset, 0);
 
-  tmpfp = m_tempfile (tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  tmpfp = m_tempfile (tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!tmpfp) {
     mutt_perror (_("Can't create temporary file"));
     return (-1);
   if (!tmpfp) {
     mutt_perror (_("Can't create temporary file"));
     return (-1);
@@ -1776,7 +1776,7 @@ int smime_decrypt_mime (FILE * fpin, FILE ** fpout, BODY * b, BODY ** cur)
   s.fpin = tmpfp;
   s.fpout = 0;
 
   s.fpin = tmpfp;
   s.fpout = 0;
 
-  *fpout = m_tempfile (tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  *fpout = m_tempfile (tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!*fpout) {
     mutt_perror (_("Can't create temporary file"));
     rv = -1;
   if (!*fpout) {
     mutt_perror (_("Can't create temporary file"));
     rv = -1;
index ddc2847..e2f5ed3 100644 (file)
@@ -119,8 +119,11 @@ exit 0
 ## dsn_return
 ## editor
 ## hcache_backend
 ## dsn_return
 ## editor
 ## hcache_backend
+## homedir
 ## quit
 ## sendmail
 ## shell
 ## sysconfdir
 ## quit
 ## sendmail
 ## shell
 ## sysconfdir
+## tmpdir
+## username
 ## version
 ## version
index aefb74f..89ff6f2 100644 (file)
@@ -31,6 +31,18 @@ static const char *madmutt_init_shell(void)
     return pw ? pw->pw_shell : (getenv("SHELL") ?: "/bin/sh");
 }
 
     return pw ? pw->pw_shell : (getenv("SHELL") ?: "/bin/sh");
 }
 
+static const char *madmutt_init_username(void)
+{
+    struct passwd *pw = getpwuid(getuid());
+    return pw ? pw->pw_name : (getenv("USER") ?: "john_doe");
+}
+
+static const char *madmutt_init_homedir(void)
+{
+    struct passwd *pw = getpwuid(getuid());
+    return pw ? pw->pw_dir : (getenv("HOME") ?: "/");
+}
+
 static const char *madmutt_pwd(void)
 {
     char path[_POSIX_PATH_MAX];
 static const char *madmutt_pwd(void)
 {
     char path[_POSIX_PATH_MAX];
@@ -87,6 +99,9 @@ static const char *luaM_path_post(const char *val)
     path_t dotlock  = BINDIR "/mutt_dotlock";
     path_t editor   = getenv("VISUAL") ?: getenv("EDITOR") ?: "vi";
     path_t shell    = madmutt_init_shell();
     path_t dotlock  = BINDIR "/mutt_dotlock";
     path_t editor   = getenv("VISUAL") ?: getenv("EDITOR") ?: "vi";
     path_t shell    = madmutt_init_shell();
+    path_t username = madmutt_init_username();
+    path_t homedir  = madmutt_init_homedir();
+    path_t tmpdir   = getenv("TMPDIR") ?: "/tmp";
 
     quadopt_t quit     = M_YES;
     bool      beep     = 1;
 
     quadopt_t quit     = M_YES;
     bool      beep     = 1;
@@ -96,7 +111,7 @@ static const char *luaM_path_post(const char *val)
 } MCore;
 
 @package MTransport {
 } MCore;
 
 @package MTransport {
-    path_t sendmail = SENDMAIL " -eom -oi";
+    path_t   sendmail = SENDMAIL " -eom -oi";
 
     string_t dsn_notify = NULL;
     string_t dsn_return = NULL;
 
     string_t dsn_notify = NULL;
     string_t dsn_return = NULL;
index 42bf5ac..0ca9ff7 100644 (file)
@@ -225,7 +225,7 @@ void rfc3676_space_stuff (HEADER* hdr) {
   if ((in = safe_fopen (hdr->content->filename, "r")) == NULL)
     return;
 
   if ((in = safe_fopen (hdr->content->filename, "r")) == NULL)
     return;
 
-  out = m_tempfile(tmpf, sizeof(tmpf), NONULL(Tempdir), NULL);
+  out = m_tempfile(tmpf, sizeof(tmpf), NONULL(MCore.tmpdir), NULL);
   if (!out) {
     m_fclose(&in);
     return;
   if (!out) {
     m_fclose(&in);
     return;
index df6c761..6e988ca 100644 (file)
@@ -196,7 +196,7 @@ int mutt_open_read_compressed(CONTEXT * ctx)
   ctx->realpath = ctx->path;
 
   /* Uncompress to /tmp */
   ctx->realpath = ctx->path;
 
   /* Uncompress to /tmp */
-  tmpfd = m_tempfd(tmppath, sizeof(tmppath), NONULL(Tempdir), NULL);
+  tmpfd = m_tempfd(tmppath, sizeof(tmppath), NONULL(MCore.tmpdir), NULL);
   /* If we cannot open tempfile, that means the file already exists (!?)
    * or we are following a symlink, which is bad and insecure.
    */
   /* If we cannot open tempfile, that means the file already exists (!?)
    * or we are following a symlink, which is bad and insecure.
    */
@@ -289,7 +289,7 @@ int mutt_open_append_compressed (CONTEXT * ctx)
   ctx->realpath = ctx->path;
 
   /* Uncompress to /tmp */
   ctx->realpath = ctx->path;
 
   /* Uncompress to /tmp */
-  fh = m_tempfile(tmppath, sizeof(tmppath), NONULL(Tempdir), NULL);
+  fh = m_tempfile(tmppath, sizeof(tmppath), NONULL(MCore.tmpdir), NULL);
   m_fclose(&fh);
 
   ctx->path = p_dupstr(tmppath, m_strlen(tmppath));
   m_fclose(&fh);
 
   ctx->path = p_dupstr(tmppath, m_strlen(tmppath));
index 7068742..60caf04 100644 (file)
@@ -546,7 +546,7 @@ static int mbox_sync_mailbox (CONTEXT * ctx, int unused __attribute__ ((unused))
     return (-1);
 
   /* Create a temporary file to write the new version of the mailbox in. */
     return (-1);
 
   /* Create a temporary file to write the new version of the mailbox in. */
-  fp = m_tempfile(tempfile, _POSIX_PATH_MAX, NONULL(Tempdir), NULL);
+  fp = m_tempfile(tempfile, _POSIX_PATH_MAX, NONULL(MCore.tmpdir), NULL);
   if (fp == NULL) {
     mutt_error _("Could not create temporary file!");
     mutt_sleep (5);
   if (fp == NULL) {
     mutt_error _("Could not create temporary file!");
     mutt_sleep (5);
@@ -718,7 +718,7 @@ static int mbox_sync_mailbox (CONTEXT * ctx, int unused __attribute__ ((unused))
     char savefile[_POSIX_PATH_MAX];
 
     snprintf(savefile, sizeof (savefile), "%s/mutt.%s-%u",
     char savefile[_POSIX_PATH_MAX];
 
     snprintf(savefile, sizeof (savefile), "%s/mutt.%s-%u",
-             NONULL(Tempdir), NONULL(Username), (unsigned int)getpid());
+             NONULL(MCore.tmpdir), NONULL(MCore.username), (unsigned int)getpid());
     rename (tempfile, savefile);
     mutt_unblock_signals ();
     mx_fastclose_mailbox (ctx);
     rename (tempfile, savefile);
     mutt_unblock_signals ();
     mx_fastclose_mailbox (ctx);
index 231d140..b6fcfc1 100644 (file)
@@ -1080,7 +1080,7 @@ MESSAGE *mx_open_new_message (CONTEXT * dest, HEADER * hdr, int flags)
           p = hdr->env->from;
       }
 
           p = hdr->env->from;
       }
 
-      fprintf (msg->fp, "From %s %s", p ? p->mailbox : NONULL (Username),
+      fprintf (msg->fp, "From %s %s", p ? p->mailbox : NONULL(MCore.username),
                ctime (&msg->received));
     }
   }
                ctime (&msg->received));
     }
   }
index 99998bb..745141b 100644 (file)
@@ -143,7 +143,7 @@ static int ssl_init (void)
     /* load entropy from egd sockets */
 #ifdef HAVE_RAND_EGD
     add_entropy (getenv ("EGDSOCKET"));
     /* load entropy from egd sockets */
 #ifdef HAVE_RAND_EGD
     add_entropy (getenv ("EGDSOCKET"));
-    snprintf (path, sizeof (path), "%s/.entropy", NONULL (Homedir));
+    snprintf (path, sizeof (path), "%s/.entropy", NONULL(MCore.homedir));
     add_entropy (path);
     add_entropy ("/tmp/entropy");
 #endif
     add_entropy (path);
     add_entropy ("/tmp/entropy");
 #endif
diff --git a/main.c b/main.c
index da1b66d..e5dc968 100644 (file)
--- a/main.c
+++ b/main.c
@@ -724,7 +724,7 @@ int main (int argc, char **argv)
 
       /* is the following if still needed? */
 
 
       /* is the following if still needed? */
 
-      fout = m_tempfile(buf, sizeof(buf), NONULL(Tempdir), NULL);
+      fout = m_tempfile(buf, sizeof(buf), NONULL(MCore.tmpdir), NULL);
       tempfile = m_strdup(buf);
 
       if (tempfile) {
       tempfile = m_strdup(buf);
 
       if (tempfile) {
index d8b94aa..48644d8 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -32,7 +32,7 @@ void mutt_adv_mktemp (const char* dir, char *s, ssize_t l)
 {
     int fd;
 
 {
     int fd;
 
-    fd = m_tempfd(s, l, m_strisempty(dir) ? NONULL(Tempdir) : dir, s);
+    fd = m_tempfd(s, l, m_strisempty(dir) ? NONULL(MCore.tmpdir) : dir, s);
     if (fd < 0) {
         *s = '\0';
     } else {
     if (fd < 0) {
         *s = '\0';
     } else {
@@ -43,7 +43,7 @@ void mutt_adv_mktemp (const char* dir, char *s, ssize_t l)
 
 void mutt_mktemp(char *s)
 {
 
 void mutt_mktemp(char *s)
 {
-    int fd = m_tempfd(s, _POSIX_PATH_MAX, NONULL(Tempdir), NULL);
+    int fd = m_tempfd(s, _POSIX_PATH_MAX, NONULL(MCore.tmpdir), NULL);
     if (fd < 0) {
         *s = '\0';
     } else {
     if (fd < 0) {
         *s = '\0';
     } else {
@@ -62,7 +62,7 @@ ssize_t _mutt_expand_path(char *buf, ssize_t len, const char *s, int rx)
     switch (*s) {
       case '~':
         if (s[1] == '/' || s[1] == '\0') {
     switch (*s) {
       case '~':
         if (s[1] == '/' || s[1] == '\0') {
-            m_strcpy(p, sizeof(p), Homedir);
+            m_strcpy(p, sizeof(p), MCore.homedir);
             tail = s + 1;
         } else {
             struct passwd *pw;
             tail = s + 1;
         } else {
             struct passwd *pw;
@@ -199,8 +199,8 @@ void mutt_pretty_mailbox (char *s)
     *s++ = '=';
     memmove (s, s + len, m_strlen(s + len) + 1);
   }
     *s++ = '=';
     memmove (s, s + len, m_strlen(s + len) + 1);
   }
-  else if (m_strncmp(s, Homedir, (len = m_strlen(Homedir))) == 0 &&
-           s[len] == '/') {
+  else if (m_strncmp(s, MCore.homedir, (len = m_strlen(MCore.homedir))) == 0
+           && s[len] == '/') {
     *s++ = '~';
     memmove (s, s + len - 1, m_strlen(s + len - 1) + 1);
   }
     *s++ = '~';
     memmove (s, s + len - 1, m_strlen(s + len - 1) + 1);
   }
index c2f8002..b7d83ea 100644 (file)
@@ -437,7 +437,7 @@ static int nntp_read_header (CONTEXT * ctx, const char *msgid,
   int ret;
   HEADER *h = ctx->hdrs[ctx->msgcount];
 
   int ret;
   HEADER *h = ctx->hdrs[ctx->msgcount];
 
-  f = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  f = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!f)
     return -1;
 
   if (!f)
     return -1;
 
@@ -915,7 +915,7 @@ int nntp_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno)
   p_delete(&cache->path);
 
   cache->index = ctx->hdrs[msgno]->index;
   p_delete(&cache->path);
 
   cache->index = ctx->hdrs[msgno]->index;
-  msg->fp = m_tempfile(path, sizeof(path), NONULL(Tempdir), NULL);
+  msg->fp = m_tempfile(path, sizeof(path), NONULL(MCore.tmpdir), NULL);
   if (!msg->fp) {
     return -1;
   }
   if (!msg->fp) {
     return -1;
   }
index 594beda..eb58688 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -141,7 +141,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno)
       p_clear(&s, 1);
       s.fpin = msg->fp;
       s.flags = M_CHARCONV;
       p_clear(&s, 1);
       s.fpin = msg->fp;
       s.flags = M_CHARCONV;
-      s.fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+      s.fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
       if (!s.fpout) {
         mutt_error(_("Could not create temporary file"));
         return (0);
       if (!s.fpout) {
         mutt_error(_("Could not create temporary file"));
         return (0);
index 9b569aa..0db1cec 100644 (file)
--- a/pop/pop.c
+++ b/pop/pop.c
@@ -45,7 +45,7 @@ static pop_query_status pop_read_header (POP_DATA * pop_data, HEADER * h)
   char buf[LONG_STRING];
   char tempfile[_POSIX_PATH_MAX];
 
   char buf[LONG_STRING];
   char tempfile[_POSIX_PATH_MAX];
 
-  f = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  f = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!f) {
     mutt_error(_("Could not create temporary file"));
     return PFD_FUNCT_ERROR;
   if (!f) {
     mutt_error(_("Could not create temporary file"));
     return PFD_FUNCT_ERROR;
@@ -349,7 +349,7 @@ int pop_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno)
     bar.msg = _("Fetching message...");
     mutt_progress_bar (&bar, 0);
 
     bar.msg = _("Fetching message...");
     mutt_progress_bar (&bar, 0);
 
-    msg->fp = m_tempfile(path, sizeof(path), NONULL(Tempdir), NULL);
+    msg->fp = m_tempfile(path, sizeof(path), NONULL(MCore.tmpdir), NULL);
     if (!msg->fp) {
       mutt_error(_("Could not create temporary file"));
       mutt_sleep(2);
     if (!msg->fp) {
       mutt_error(_("Could not create temporary file"));
       mutt_sleep(2);
index a2e03b0..165438d 100644 (file)
@@ -597,7 +597,7 @@ int mutt_prepare_template (FILE * fp, CONTEXT * ctx, HEADER * newhdr,
       parameter_delval(&b->parameter, "x-mutt-noconv");
     }
 
       parameter_delval(&b->parameter, "x-mutt-noconv");
     }
 
-    s.fpout = m_tempfile(file, sizeof(file), NONULL(Tempdir), file);
+    s.fpout = m_tempfile(file, sizeof(file), NONULL(MCore.tmpdir), file);
     if (!s.fpout)
       goto bail;
 
     if (!s.fpout)
       goto bail;
 
index b9db799..198bfa7 100644 (file)
@@ -500,7 +500,7 @@ mutt_query_pipe_attachment(char *command, FILE * fp, BODY * body, int afilter)
       CLEARLINE (LINES - 1);
       return;
     }
       CLEARLINE (LINES - 1);
       return;
     }
-    tempfd = m_tempfd(tfile, sizeof(tfile), NONULL(Tempdir), NULL);
+    tempfd = m_tempfd(tfile, sizeof(tfile), NONULL(MCore.tmpdir), NULL);
   }
 
   if (mutt_pipe_attachment(fp, body, command, tempfd)) {
   }
 
   if (mutt_pipe_attachment(fp, body, command, tempfd)) {
@@ -634,7 +634,7 @@ static void print_attachment_list (FILE * fp, int tag, BODY * top,
           FILE *ifp;
           int newfile_fd;
 
           FILE *ifp;
           int newfile_fd;
 
-          newfile_fd = m_tempfd(newfile, sizeof(newfile), NONULL(Tempdir), NULL);
+          newfile_fd = m_tempfd(newfile, sizeof(newfile), NONULL(MCore.tmpdir), NULL);
           if (mutt_decode_save_attachment (fp, top, newfile_fd, M_PRINTING) == 0) {
             if ((ifp = fopen (newfile, "r")) != NULL) {
               mutt_copy_stream (ifp, state->fpout);
           if (mutt_decode_save_attachment (fp, top, newfile_fd, M_PRINTING) == 0) {
             if ((ifp = fopen (newfile, "r")) != NULL) {
               mutt_copy_stream (ifp, state->fpout);
index e4db1d8..4ab7a87 100644 (file)
--- a/recvcmd.c
+++ b/recvcmd.c
@@ -440,7 +440,7 @@ static void attach_forward_bodies (FILE * fp, HEADER * hdr,
   tmphdr->env = envelope_new();
   mutt_make_forward_subject (tmphdr->env, Context, parent);
 
   tmphdr->env = envelope_new();
   mutt_make_forward_subject (tmphdr->env, Context, parent);
 
-  tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(Tempdir), NULL);
+  tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(MCore.tmpdir), NULL);
   if (!tmpfp) {
     mutt_error(_("Could not create temporary file"));
     return;
   if (!tmpfp) {
     mutt_error(_("Could not create temporary file"));
     return;
@@ -602,7 +602,7 @@ static void attach_forward_msgs (FILE * fp, HEADER * hdr __attribute__ ((unused)
 
     /* no MIME encapsulation */
 
 
     /* no MIME encapsulation */
 
-    tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(Tempdir), NULL);
+    tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(MCore.tmpdir), NULL);
     if (!tmpfp) {
       mutt_error(_("Could not create temporary file"));
       header_delete(&tmphdr);
     if (!tmpfp) {
       mutt_error(_("Could not create temporary file"));
       header_delete(&tmphdr);
@@ -850,7 +850,7 @@ void mutt_attach_reply (FILE * fp, HEADER * hdr,
     return;
   }
 
     return;
   }
 
-  tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(Tempdir), NULL);
+  tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(MCore.tmpdir), NULL);
   if (!tmpfp) {
     mutt_error(_("Could not create temporary file"));
     header_delete(&tmphdr);
   if (!tmpfp) {
     mutt_error(_("Could not create temporary file"));
     header_delete(&tmphdr);
diff --git a/send.c b/send.c
index 2143f19..6ca6963 100644 (file)
--- a/send.c
+++ b/send.c
@@ -968,11 +968,11 @@ address_t *mutt_default_from (void)
   else if (option (OPTUSEDOMAIN)) {
     const char *fqdn = mutt_fqdn (1);
     adr = address_new();
   else if (option (OPTUSEDOMAIN)) {
     const char *fqdn = mutt_fqdn (1);
     adr = address_new();
-    adr->mailbox = p_new(char, m_strlen(Username) + m_strlen(fqdn) + 2);
-    sprintf(adr->mailbox, "%s@%s", NONULL(Username), NONULL(fqdn));
+    adr->mailbox = p_new(char, m_strlen(MCore.username) + m_strlen(fqdn) + 2);
+    sprintf(adr->mailbox, "%s@%s", NONULL(MCore.username), NONULL(fqdn));
   } else {
     adr = address_new ();
   } else {
     adr = address_new ();
-    adr->mailbox = m_strdup(NONULL(Username));
+    adr->mailbox = m_strdup(NONULL(MCore.username));
   }
 
   return (adr);
   }
 
   return (adr);
@@ -985,7 +985,7 @@ static int send_message (HEADER * msg)
   int i;
 
   /* Write out the message in MIME form. */
   int i;
 
   /* Write out the message in MIME form. */
-  tempfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+  tempfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(MCore.tmpdir), NULL);
   if (!tempfp)
     return -1;
 
   if (!tempfp)
     return -1;
 
@@ -1183,7 +1183,7 @@ int ci_send_message (int flags, /* send mode */
 
     if (!tempfile) {
       char buffer[_POSIX_PATH_MAX];
 
     if (!tempfile) {
       char buffer[_POSIX_PATH_MAX];
-      tempfp = m_tempfile(buffer, sizeof(buffer), NONULL(Tempdir), NULL);
+      tempfp = m_tempfile(buffer, sizeof(buffer), NONULL(MCore.tmpdir), NULL);
       msg->content->filename = m_strdup(buffer);
     } else {
       tempfp = safe_fopen(tempfile, "a+");
       msg->content->filename = m_strdup(buffer);
     } else {
       tempfp = safe_fopen(tempfile, "a+");
index cc456b3..666ccba 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -829,7 +829,7 @@ int mutt_lookup_mime_type (BODY * att, const char *path)
      */
     switch (count) {
     case 0:
      */
     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");
       break;
     case 1:
       m_strcpy(buf, sizeof(buf), SYSCONFDIR "/madmutt-mime.types");
@@ -925,7 +925,7 @@ void mutt_message_to_7bit (BODY * a, FILE * fp)
     a->length = sb.st_size;
   }
 
     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;
   if (!fpout) {
     mutt_error(_("Could not create temporary file"));
     goto cleanup;
@@ -990,7 +990,7 @@ static void transform_to_7bit (BODY * a, FILE * fpin)
       a->noconv = 1;
       a->force_charset = 1;
 
       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;
       if (!s.fpout) {
         mutt_error(_("Could not create temporary file"));
         return;
@@ -1114,7 +1114,7 @@ BODY *mutt_make_message_attach (CONTEXT * ctx, HEADER * hdr, int attach_msg)
       return (NULL);
   }
 
       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;
 
   if (!fp)
     return NULL;
 
@@ -2038,7 +2038,7 @@ static int _mutt_bounce_message (FILE * fp, HEADER * h, address_t * to,
   if (!fp)
     fp = msg->fp;
 
   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;
 
   if (f) {
     int ch_flags = CH_XMIT | CH_NONEWLINE | CH_NOQFROM;
 
@@ -2128,7 +2128,7 @@ int mutt_write_fcc (const char *path, HEADER * hdr, const char *msgid,
    * the message body begins with "From "   
    */
   if (f.magic == M_MMDF || f.magic == M_MBOX) {
    * 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);
     if (!tempfp) {
       mutt_error(_("Could not create temporary file"));
       mx_close_mailbox (&f, NULL);