Changeset 364:efa46a89a622

Show
Ignore:
Timestamp:
1998-08-20 15:32:34 (10 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
mutt-0-94
Message:

[patch-0.94.3.bl.other_types.1] This patch adds support
for the model MIME type. Additionally, along the lines of
"strict in what you generate, accepting in what you
receive", this patch will keep the name of major mime
types it doesn't recognize (instead of using x-unknown).

Files:
12 modified

Legend:

Unmodified
Added
Removed
  • BUGS

    r362 r364  
    3838  it doesn't honor $tmpdir under some conditions if 
    3939  matching nametemplates exist. 
     40 
  • attach.c

    r358 r364  
    4848  rfc1524_entry *entry = rfc1524_new_entry (); 
    4949 
    50   snprintf (type, sizeof (type), "%s/%s", TYPE (a->type), a->subtype); 
     50  snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype); 
    5151  if (rfc1524_mailcap_lookup (a, type, entry, M_COMPOSE)) 
    5252  { 
     
    166166  rfc1524_entry *entry = rfc1524_new_entry (); 
    167167 
    168   snprintf (type, sizeof (type), "%s/%s", TYPE (a->type), a->subtype); 
     168  snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype); 
    169169  if (rfc1524_mailcap_lookup (a, type, entry, M_EDIT)) 
    170170  { 
     
    262262  use_mailcap = (flag == M_MAILCAP || 
    263263                (flag == M_REGULAR && mutt_needs_mailcap (a))); 
    264   snprintf (type, sizeof (type), "%s/%s", TYPE (a->type), a->subtype); 
     264  snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype); 
    265265   
    266266  if (use_mailcap) 
     
    736736  FILE *ifp, *fpout; 
    737737 
    738   snprintf (type, sizeof (type), "%s/%s", TYPE (a->type), a->subtype); 
     738  snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype); 
    739739 
    740740  if (rfc1524_mailcap_lookup (a, type, NULL, M_PRINT))  
  • commands.c

    r264 r364  
    111111  FILE *fpout; 
    112112 
    113   snprintf (buf, sizeof (buf), "%s/%s", TYPE (cur->content->type), 
     113  snprintf (buf, sizeof (buf), "%s/%s", TYPE (cur->content), 
    114114            cur->content->subtype); 
    115115 
  • compose.c

    r362 r364  
    767767        CHECK_COUNT; 
    768768        snprintf (buf, sizeof (buf), "%s/%s", 
    769                   TYPE (idx[menu->current]->content->type), 
     769                  TYPE (idx[menu->current]->content), 
    770770                  idx[menu->current]->content->subtype); 
    771771        if (mutt_get_field ("Content-Type: ", buf, sizeof (buf), 0) == 0 && buf[0]) 
  • globals.h

    r164 r364  
    126126const char *Months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "ERR" }; 
    127127 
    128 const char *BodyTypes[] = { "x-unknown", "audio", "application", "image", "message", "multipart", "text", "video" }; 
     128const char *BodyTypes[] = { "x-unknown", "audio", "application", "image", "message", "model", "multipart", "text", "video" }; 
    129129const char *BodyEncodings[] = { "x-unknown", "7bit", "8bit", "quoted-printable", "base64", "binary" }; 
    130130#else 
  • handler.c

    r360 r364  
    754754          (i > 0 && t->data[i-1] == '/' && t->data[i] == '*')) 
    755755      { 
    756         if (!strcasecmp(t->data, TYPE(b->type))) 
     756        if (!strcasecmp(t->data, TYPE(b))) 
    757757        { 
    758758          choice = b; 
     
    761761      else 
    762762      { 
    763         snprintf (buf, sizeof (buf), "%s/%s", TYPE (b->type), b->subtype); 
     763        snprintf (buf, sizeof (buf), "%s/%s", TYPE (b), b->subtype); 
    764764        if (!strcasecmp(t->data, buf)) 
    765765        { 
     
    778778  while (b && !choice) 
    779779  { 
    780     snprintf (buf, sizeof (buf), "%s/%s", TYPE (b->type), b->subtype); 
     780    snprintf (buf, sizeof (buf), "%s/%s", TYPE (b), b->subtype); 
    781781    if (mutt_is_autoview (buf)) 
    782782    { 
     
    898898  char type[STRING]; 
    899899 
    900   snprintf (type, sizeof (type), "%s/%s", TYPE (a->type), a->subtype); 
     900  snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype); 
    901901  if (mutt_is_autoview (type)) 
    902902    return (rfc1524_mailcap_lookup (a, type, NULL, M_AUTOVIEW)); 
     
    986986      snprintf (buffer, sizeof (buffer), 
    987987                "[-- Type: %s/%s, Encoding: %s, Size: %s --]\n", 
    988                TYPE (p->type), p->subtype, ENCODING (p->encoding), length); 
     988               TYPE (p), p->subtype, ENCODING (p->encoding), length); 
    989989      state_puts (buffer, s); 
    990990      if (!option (OPTWEED)) 
     
    10321032  pid_t thepid; 
    10331033 
    1034   snprintf (type, sizeof (type), "%s/%s", TYPE (a->type), a->subtype); 
     1034  snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype); 
    10351035  rfc1524_mailcap_lookup (a, type, entry, M_AUTOVIEW); 
    10361036 
     
    11621162  /* first determine which handler to use to process this part */ 
    11631163 
    1164   snprintf (type, sizeof (type), "%s/%s", TYPE (b->type), b->subtype); 
     1164  snprintf (type, sizeof (type), "%s/%s", TYPE (b), b->subtype); 
    11651165  if (mutt_is_autoview (type)) 
    11661166  { 
     
    13331333  else if (s->flags & M_DISPLAY) 
    13341334  { 
    1335     fprintf (s->fpout, "[-- %s/%s is unsupported ", TYPE (b->type), b->subtype); 
     1335    fprintf (s->fpout, "[-- %s/%s is unsupported ", TYPE (b), b->subtype); 
    13361336    if (!option (OPTVIEWATTACH)) 
    13371337    { 
  • lib.c

    r348 r364  
    6666    safe_free ((void **) &b->filename); 
    6767    safe_free ((void **) &b->content); 
     68    safe_free ((void **) &b->xtype); 
    6869    safe_free ((void **) &b->subtype); 
    6970    safe_free ((void **) &b->description); 
  • mime.h

    r118 r364  
    2525  TYPEIMAGE, 
    2626  TYPEMESSAGE, 
     27  TYPEMODEL, 
    2728  TYPEMULTIPART, 
    2829  TYPETEXT, 
     
    6566extern const char *BodyEncodings[]; 
    6667 
    67 #define TYPE(X) BodyTypes[(X)] 
     68#define TYPE(X) ((X->type == TYPEOTHER) && (X->xtype != NULL) ? X->xtype : BodyTypes[(X->type)]) 
    6869#define ENCODING(X) BodyEncodings[(X)] 
  • mutt.h

    r330 r364  
    407407typedef struct body 
    408408{ 
     409  char *xtype;                  /* content-type if x-unknown */ 
    409410  char *subtype;                /* content-type subtype */ 
    410411  PARAMETER *parameter;         /* parameters of the content-type */ 
  • parse.c

    r348 r364  
    277277  ct->type = mutt_check_mime_type (s); 
    278278 
     279  if (ct->type == TYPEOTHER) 
     280  { 
     281    ct->xtype = safe_strdup (s); 
     282  } 
     283 
    279284  if (ct->subtype == NULL) 
    280285  { 
     
    299304      ct->subtype = safe_strdup ("x-unknown"); 
    300305  } 
     306 
    301307} 
    302308 
  • recvattach.c

    r333 r364  
    206206    case 'm': 
    207207      snprintf (fmt, sizeof (fmt), "%%%ss", prefix); 
    208       snprintf (dest, destlen, fmt, TYPE (aptr->content->type)); 
     208      snprintf (dest, destlen, fmt, TYPE (aptr->content)); 
    209209      break; 
    210210    case 'M': 
  • sendlib.c

    r358 r364  
    366366  int tmplen; 
    367367   
    368   fprintf (f, "Content-Type: %s/%s", TYPE (a->type), a->subtype); 
     368  fprintf (f, "Content-Type: %s/%s", TYPE (a), a->subtype); 
    369369 
    370370  if (a->parameter)