mutt stable branch with some hacks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Convert mutt_attach_reply() to use buffer pool.

+21 -15
+21 -15
recvcmd.c
··· 880 880 short i; 881 881 882 882 STATE st; 883 - char tmpbody[_POSIX_PATH_MAX]; 884 - FILE *tmpfp; 883 + BUFFER *tmpbody = NULL; 884 + FILE *tmpfp = NULL; 885 885 886 886 char prefix[SHORT_STRING]; 887 887 int rc; ··· 917 917 918 918 if (attach_reply_envelope_defaults (tmphdr->env, actx, 919 919 parent_hdr ? parent_hdr : (cur ? cur->hdr : NULL), flags) == -1) 920 - { 921 - mutt_free_header (&tmphdr); 922 - return; 923 - } 920 + goto cleanup; 924 921 925 - mutt_mktemp (tmpbody, sizeof (tmpbody)); 926 - if ((tmpfp = safe_fopen (tmpbody, "w")) == NULL) 922 + tmpbody = mutt_buffer_pool_get (); 923 + mutt_buffer_mktemp (tmpbody); 924 + if ((tmpfp = safe_fopen (mutt_b2s (tmpbody), "w")) == NULL) 927 925 { 928 - mutt_error (_("Can't create %s."), tmpbody); 929 - mutt_free_header (&tmphdr); 930 - return; 926 + mutt_error (_("Can't create %s."), mutt_b2s (tmpbody)); 927 + goto cleanup; 931 928 } 932 929 933 930 if (!parent_hdr) ··· 994 991 if (mime_reply_any && !cur && 995 992 copy_problematic_attachments (&tmphdr->content, actx, 0) == NULL) 996 993 { 997 - mutt_free_header (&tmphdr); 998 - safe_fclose (&tmpfp); 999 - return; 994 + goto cleanup; 1000 995 } 1001 996 } 1002 997 1003 998 safe_fclose (&tmpfp); 1004 999 1005 - if (ci_send_message (flags, tmphdr, tmpbody, NULL, 1000 + if (ci_send_message (flags, tmphdr, mutt_b2s (tmpbody), NULL, 1006 1001 parent_hdr ? parent_hdr : (cur ? cur->hdr : NULL)) == 0) 1007 1002 mutt_set_flag (Context, hdr, MUTT_REPLIED, 1); 1003 + 1004 + tmphdr = NULL; /* ci_send_message frees this */ 1005 + 1006 + cleanup: 1007 + if (tmpfp) 1008 + { 1009 + safe_fclose (&tmpfp); 1010 + mutt_unlink (mutt_b2s (tmpbody)); 1011 + } 1012 + mutt_buffer_pool_release (&tmpbody); 1013 + mutt_free_header (&tmphdr); 1008 1014 }