Commit 34becd65 34becd653a1625f2ba1f77917d13f16110f704cd by Sergey Poznyakoff

(main): Use mh_open_folder.

1 parent c7578789
Showing 1 changed file with 2 additions and 19 deletions
...@@ -187,24 +187,7 @@ main (int argc, char **argv) ...@@ -187,24 +187,7 @@ main (int argc, char **argv)
187 exit (1); 187 exit (1);
188 } 188 }
189 189
190 /* Select and open output mailbox */ 190 output = mh_open_folder (current_folder, 1);
191 if (mh_check_folder (current_folder))
192 exit (0);
193
194 if (mailbox_create_default (&output, current_folder))
195 {
196 mh_error ("Can't create output mailbox %s: %s",
197 current_folder, strerror (errno));
198 exit (1);
199 }
200
201 if (mailbox_open (output, MU_STREAM_RDWR|MU_STREAM_CREAT))
202 {
203 mh_error ("Can't open mailbox %s: %s", current_folder,
204 strerror (errno));
205 exit (1);
206 }
207
208 if (mailbox_messages_count (output, &lastmsg) != 0) 191 if (mailbox_messages_count (output, &lastmsg) != 0)
209 { 192 {
210 mh_error ("Can not read output mailbox"); 193 mh_error ("Can not read output mailbox");
...@@ -242,7 +225,7 @@ main (int argc, char **argv) ...@@ -242,7 +225,7 @@ main (int argc, char **argv)
242 225
243 if (n == 1 && changecur) 226 if (n == 1 && changecur)
244 { 227 {
245 message_t msg; 228 message_t msg = NULL;
246 229
247 mailbox_get_message (output, lastmsg+1, &msg); 230 mailbox_get_message (output, lastmsg+1, &msg);
248 mh_message_number (msg, &current_message); 231 mh_message_number (msg, &current_message);
......