else
mutt_perror(fpin ? tempfile : a->filename);
- if(fpin) fclose(fpin);
- if(fpout) fclose(fpout);
+ if(fpin) safe_fclose (&fpin);
+ if(fpout) safe_fclose (&fpout);
return a->unlink ? 0 : -1;
}
goto bailout;
}
mutt_copy_stream (fp, tfp);
- fclose (fp);
- fclose (tfp);
+ safe_fclose (&fp);
+ safe_fclose (&tfp);
mutt_unlink (a->filename);
if (mutt_rename_file (tempfile, a->filename) != 0)
{
int use_pipe = 0;
int use_pager = 1;
char type[STRING];
- char command[STRING];
+ char command[HUGE_STRING];
char descrip[STRING];
char *fname;
rfc1524_entry *entry = NULL;
{
if (a->description)
snprintf (descrip, sizeof (descrip),
- "---Command: %-20.20s Description: %s",
+ _("---Command: %-20.20s Description: %s"),
command, a->description);
else
snprintf (descrip, sizeof (descrip),
- "---Command: %-30.30s Attachment: %s", command, type);
+ _("---Command: %-30.30s Attachment: %s"), command, type);
}
if ((mutt_wait_filter (thepid) || (entry->needsterminal &&
if (a->description)
strfcpy (descrip, a->description, sizeof (descrip));
else if (a->filename)
- snprintf (descrip, sizeof (descrip), "---Attachment: %s : %s",
+ snprintf (descrip, sizeof (descrip), _("---Attachment: %s: %s"),
a->filename, type);
else
- snprintf (descrip, sizeof (descrip), "---Attachment: %s", type);
+ snprintf (descrip, sizeof (descrip), _("---Attachment: %s"), type);
}
/* We only reach this point if there have been no errors */
else
{
/* In recv mode, extract from folder and decode */
-
+
STATE s;
-
+
memset (&s, 0, sizeof (s));
+ s.flags |= M_CHARCONV;
+
if ((s.fpout = mutt_save_attachment_open (path, flags)) == NULL)
{
mutt_perror ("fopen");
+ mutt_sleep (2);
return (-1);
}
fseeko ((s.fpin = fp), m->offset, 0);
mutt_decode_attachment (m, &s);
-
+
if (fclose (s.fpout) != 0)
{
mutt_perror ("fclose");
+ mutt_sleep (2);
return (-1);
}
}
if (stat (m->filename, &st) == -1)
{
mutt_perror ("stat");
- fclose (s.fpout);
+ safe_fclose (&s.fpout);
return (-1);
}
mutt_body_handler (m, &s);
- fclose (s.fpout);
+ safe_fclose (&s.fpout);
if (fp == NULL)
{
m->length = 0;
m->parts = saved_parts;
m->hdr = saved_hdr;
}
- fclose (s.fpin);
+ safe_fclose (&s.fpin);
}
return (0);