186 |
mh_error ("Can not read input mailbox"); |
mh_error ("Can not read input mailbox"); |
187 |
exit (1); |
exit (1); |
188 |
} |
} |
|
|
|
|
/* Select and open output mailbox */ |
|
|
if (mh_check_folder (current_folder)) |
|
|
exit (0); |
|
|
|
|
|
if (mailbox_create_default (&output, current_folder)) |
|
|
{ |
|
|
mh_error ("Can't create output mailbox %s: %s", |
|
|
current_folder, strerror (errno)); |
|
|
exit (1); |
|
|
} |
|
|
|
|
|
if (mailbox_open (output, MU_STREAM_RDWR|MU_STREAM_CREAT)) |
|
|
{ |
|
|
mh_error ("Can't open mailbox %s: %s", current_folder, |
|
|
strerror (errno)); |
|
|
exit (1); |
|
|
} |
|
189 |
|
|
190 |
|
output = mh_open_folder (current_folder, 1); |
191 |
if (mailbox_messages_count (output, &lastmsg) != 0) |
if (mailbox_messages_count (output, &lastmsg) != 0) |
192 |
{ |
{ |
193 |
mh_error ("Can not read output mailbox"); |
mh_error ("Can not read output mailbox"); |
194 |
exit (1); |
exit (1); |
195 |
} |
} |
196 |
|
|
197 |
buffer = xmalloc (width); |
buffer = xmalloc (width); |
198 |
|
|
199 |
/* Fixup options */ |
/* Fixup options */ |
225 |
|
|
226 |
if (n == 1 && changecur) |
if (n == 1 && changecur) |
227 |
{ |
{ |
228 |
message_t msg; |
message_t msg = NULL; |
229 |
|
|
230 |
mailbox_get_message (output, lastmsg+1, &msg); |
mailbox_get_message (output, lastmsg+1, &msg); |
231 |
mh_message_number (msg, ¤t_message); |
mh_message_number (msg, ¤t_message); |