WHERE char *C_ImapUser; ///< Config: (imap) Username for the IMAP server
#endif
WHERE char *C_Mbox; ///< Config: Folder that receives read emails (see Move)
-WHERE char *C_MailcapPath; ///< Config: Colon-separated list of mailcap files
+WHERE struct Slist *C_MailcapPath; ///< Config: Colon-separated list of mailcap files
WHERE char *C_Folder; ///< Config: Base folder for a set of mailboxes
#ifdef USE_HCACHE
WHERE char *C_HeaderCache; ///< Config: (hcache) Directory/file for the header cache database
** When $$mail_check_stats is \fIset\fP, this variable configures
** how often (in seconds) NeoMutt will update message counts.
*/
- { "mailcap_path", DT_STRING, &C_MailcapPath, IP "~/.mailcap:" PKGDATADIR "/mailcap:" SYSCONFDIR "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap" },
+ { "mailcap_path", DT_SLIST|SLIST_SEP_COLON, &C_MailcapPath, IP "~/.mailcap:" PKGDATADIR "/mailcap:" SYSCONFDIR "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap" },
/*
** .pp
** This variable specifies which files to consult when attempting to
bool rfc1524_mailcap_lookup(struct Body *a, char *type,
struct Rfc1524MailcapEntry *entry, enum MailcapLookup opt)
{
- char path[PATH_MAX];
- int found = false;
- char *curr = C_MailcapPath;
-
/* rfc1524 specifies that a path of mailcap files should be searched.
* joy. They say
* $HOME/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap, etc
* and overridden by the MAILCAPS environment variable, and, just to be nice,
* we'll make it specifiable in .neomuttrc */
- if (!curr || !*curr)
+ if (!C_MailcapPath || (C_MailcapPath->count == 0))
{
mutt_error(_("No mailcap path specified"));
return false;
mutt_check_lookup_list(a, type, 128);
- while (!found && *curr)
- {
- int x = 0;
- while (*curr && (*curr != ':') && (x < sizeof(path) - 1))
- {
- path[x++] = *curr;
- curr++;
- }
- if (*curr)
- curr++;
-
- if (x == 0)
- continue;
+ char path[PATH_MAX];
+ bool found = false;
- path[x] = '\0';
+ struct ListNode *np = NULL;
+ STAILQ_FOREACH(np, &C_MailcapPath->head, entries)
+ {
+ mutt_str_strfcpy(path, np->data, sizeof(path));
mutt_expand_path(path, sizeof(path));
mutt_debug(LL_DEBUG2, "Checking mailcap file: %s\n", path);
found = rfc1524_mailcap_parse(a, path, type, entry, opt);
+ if (found)
+ break;
}
if (entry && !found)