mutt stable branch with some hacks
0
fork

Configure Feed

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

Convert edit_one_message() to use buffer pool.

+17 -13
+17 -13
editmsg.c
··· 45 45 46 46 static int edit_one_message (CONTEXT *ctx, HEADER *cur) 47 47 { 48 - char tmp[_POSIX_PATH_MAX]; 48 + BUFFER *tmp = NULL; 49 49 char buff[STRING]; 50 50 int omagic; 51 51 int oerrno; ··· 64 64 struct stat sb; 65 65 time_t mtime = 0; 66 66 67 - mutt_mktemp (tmp, sizeof (tmp)); 67 + tmp = mutt_buffer_pool_get (); 68 + mutt_buffer_mktemp (tmp); 68 69 69 70 omagic = DefaultMagic; 70 71 DefaultMagic = MUTT_MBOX; 71 72 72 - rc = (mx_open_mailbox (tmp, MUTT_NEWFOLDER, &tmpctx) == NULL) ? -1 : 0; 73 + rc = (mx_open_mailbox (mutt_b2s (tmp), MUTT_NEWFOLDER, &tmpctx) == NULL) ? -1 : 0; 73 74 74 75 DefaultMagic = omagic; 75 76 76 77 if (rc == -1) 77 78 { 78 79 mutt_error (_("could not create temporary folder: %s"), strerror (errno)); 80 + mutt_buffer_pool_release (&tmp); 79 81 return -1; 80 82 } 81 83 ··· 91 93 goto bail; 92 94 } 93 95 94 - if ((rc = stat (tmp, &sb)) == -1) 96 + if ((rc = stat (mutt_b2s (tmp), &sb)) == -1) 95 97 { 96 - mutt_error (_("Can't stat %s: %s"), tmp, strerror (errno)); 98 + mutt_error (_("Can't stat %s: %s"), mutt_b2s (tmp), strerror (errno)); 97 99 goto bail; 98 100 } 99 101 ··· 105 107 * remove it, the message will grow by one line each time the user edits 106 108 * the message. 107 109 */ 108 - if (sb.st_size != 0 && truncate (tmp, sb.st_size - 1) == -1) 110 + if (sb.st_size != 0 && 111 + truncate (mutt_b2s (tmp), sb.st_size - 1) == -1) 109 112 { 110 113 mutt_error (_("could not truncate temporary mail folder: %s"), 111 114 strerror (errno)); 112 115 goto bail; 113 116 } 114 117 115 - mtime = mutt_decrease_mtime (tmp, &sb); 118 + mtime = mutt_decrease_mtime (mutt_b2s (tmp), &sb); 116 119 117 - mutt_edit_file (NONULL(Editor), tmp); 120 + mutt_edit_file (NONULL(Editor), mutt_b2s (tmp)); 118 121 119 - if ((rc = stat (tmp, &sb)) == -1) 122 + if ((rc = stat (mutt_b2s (tmp), &sb)) == -1) 120 123 { 121 - mutt_error (_("Can't stat %s: %s"), tmp, strerror (errno)); 124 + mutt_error (_("Can't stat %s: %s"), mutt_b2s (tmp), strerror (errno)); 122 125 goto bail; 123 126 } 124 127 ··· 136 139 goto bail; 137 140 } 138 141 139 - if ((fp = fopen (tmp, "r")) == NULL) 142 + if ((fp = fopen (mutt_b2s (tmp), "r")) == NULL) 140 143 { 141 144 rc = -1; 142 145 mutt_error (_("Can't open message file: %s"), strerror (errno)); ··· 195 198 if (fp) safe_fclose (&fp); 196 199 197 200 if (rc >= 0) 198 - unlink (tmp); 201 + unlink (mutt_b2s (tmp)); 199 202 200 203 if (rc == 0) 201 204 { ··· 207 210 mutt_set_flag (Context, cur, MUTT_TAG, 0); 208 211 } 209 212 else if (rc == -1) 210 - mutt_message (_("Error. Preserving temporary file: %s"), tmp); 213 + mutt_message (_("Error. Preserving temporary file: %s"), mutt_b2s (tmp)); 211 214 215 + mutt_buffer_pool_release (&tmp); 212 216 213 217 return rc; 214 218 }