entry = rfc1524_new_entry();
snprintf(type, sizeof(type), "%s/%s", TYPE(a), a->subtype);
- rfc1524_mailcap_lookup(a, type, entry, 0);
+ rfc1524_mailcap_lookup(a, type, sizeof(type), entry, 0);
mutt_rfc1524_expand_filename (entry->nametemplate, a->filename, tempfile);
rfc1524_free_entry(&entry);
int rc = 0;
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
- if (rfc1524_mailcap_lookup (a, type, entry, MUTT_COMPOSE))
+ if (rfc1524_mailcap_lookup (a, type, sizeof(type), entry, MUTT_COMPOSE))
{
if (entry->composecommand || entry->composetypecommand)
{
int rc = 0;
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
- if (rfc1524_mailcap_lookup (a, type, entry, MUTT_EDIT))
+ if (rfc1524_mailcap_lookup (a, type, sizeof(type), entry, MUTT_EDIT))
{
if (entry->editcommand)
{
}
-void mutt_check_lookup_list (BODY *b, char *type, int len)
+void mutt_check_lookup_list (BODY *b, char *type, size_t len)
{
LIST *t = MimeLookupList;
int i;
if (use_mailcap)
{
entry = rfc1524_new_entry ();
- if (!rfc1524_mailcap_lookup (a, type, entry, 0))
+ if (!rfc1524_mailcap_lookup (a, type, sizeof(type), entry, 0))
{
if (flag == MUTT_REGULAR)
{
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
- if (rfc1524_mailcap_lookup (a, type, NULL, MUTT_PRINT))
+ if (rfc1524_mailcap_lookup (a, type, sizeof(type), NULL, MUTT_PRINT))
{
rfc1524_entry *entry = NULL;
int piped = FALSE;
dprint (2, (debugfile, "Using mailcap...\n"));
entry = rfc1524_new_entry ();
- rfc1524_mailcap_lookup (a, type, entry, MUTT_PRINT);
+ rfc1524_mailcap_lookup (a, type, sizeof(type), entry, MUTT_PRINT);
mutt_rfc1524_expand_filename (entry->nametemplate, a->filename,
newfile);
*/
static int mutt_is_autoview (BODY *b)
{
- char type[SHORT_STRING];
+ char type[STRING];
int is_autoview = 0;
snprintf (type, sizeof (type), "%s/%s", TYPE (b), b->subtype);
*
* WARNING: type is altered by this call as a result of `mime_lookup' support */
if (is_autoview)
- return rfc1524_mailcap_lookup(b, type, NULL, MUTT_AUTOVIEW);
+ return rfc1524_mailcap_lookup(b, type, sizeof(type), NULL, MUTT_AUTOVIEW);
return 0;
}
tempfile = mutt_buffer_pool_get ();
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
- rfc1524_mailcap_lookup (a, type, entry, MUTT_AUTOVIEW);
+ rfc1524_mailcap_lookup (a, type, sizeof(type), entry, MUTT_AUTOVIEW);
fname = safe_strdup (a->filename);
mutt_sanitize_filename (fname, 1);
void mutt_help (int);
const char *mutt_idxfmt_hook (const char *, CONTEXT *, HEADER *);
void mutt_draw_tree (CONTEXT *);
-void mutt_check_lookup_list (BODY *, char *, int);
+void mutt_check_lookup_list (BODY *, char *, size_t);
void mutt_make_attribution (CONTEXT *ctx, HEADER *cur, FILE *out);
void mutt_make_forward_subject (ENVELOPE *env, CONTEXT *ctx, HEADER *cur);
void mutt_make_help (char *, size_t, const char *, int, int);
snprintf (type, sizeof (type), "%s/%s", TYPE (top), top->subtype);
if (!tag || top->tagged)
{
- if (!rfc1524_mailcap_lookup (top, type, NULL, MUTT_PRINT))
+ if (!rfc1524_mailcap_lookup (top, type, sizeof(type), NULL, MUTT_PRINT))
{
if (ascii_strcasecmp ("text/plain", top->subtype) &&
ascii_strcasecmp ("application/postscript", top->subtype))
if (!tag || top->tagged)
{
snprintf (type, sizeof (type), "%s/%s", TYPE (top), top->subtype);
- if (!option (OPTATTACHSPLIT) && !rfc1524_mailcap_lookup (top, type, NULL, MUTT_PRINT))
+ if (!option (OPTATTACHSPLIT) &&
+ !rfc1524_mailcap_lookup (top, type, sizeof(type), NULL, MUTT_PRINT))
{
if (!ascii_strcasecmp ("text/plain", top->subtype) ||
!ascii_strcasecmp ("application/postscript", top->subtype))
* in *entry, and returns 1. On failure (not found), returns 0.
* If entry == NULL just return 1 if the given type is found.
*/
-int rfc1524_mailcap_lookup (BODY *a, char *type, rfc1524_entry *entry, int opt)
+int rfc1524_mailcap_lookup (BODY *a, char *type, size_t typelen, rfc1524_entry *entry, int opt)
{
BUFFER *path = NULL;
int found = FALSE;
return 0;
}
- /* FIXME: sizeof type should be passed to rfc1524_mailcap_lookup() */
- mutt_check_lookup_list (a, type, SHORT_STRING);
+ mutt_check_lookup_list (a, type, typelen);
path = mutt_buffer_pool_get ();
void rfc1524_free_entry (rfc1524_entry **);
int mutt_rfc1524_expand_command (BODY *, const char *, const char *, BUFFER *);
void mutt_rfc1524_expand_filename (const char *, const char *, BUFFER *);
-int rfc1524_mailcap_lookup (BODY *, char *, rfc1524_entry *, int);
+int rfc1524_mailcap_lookup (BODY *, char *, size_t, rfc1524_entry *, int);
int mutt_rename_file (const char *, const char *);
#endif /* _RFC1524_H */