From ea361ad11672ece96dbb2e056ae0c4b2725c1fc0 Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Thu, 21 Jun 2001 20:45:50 +0000 Subject: [PATCH] fixed core when specifying multiple mailboxes on the command line --- main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 0f0a53a..53c64d8 100644 --- a/main.c +++ b/main.c @@ -218,8 +218,7 @@ main (int argc, char **argv) load_config (config); - for (box = boxes; (all && box) || (!all && argv[optind]); - box = box->next, optind++) + for (box = boxes; (all && box) || (!all && argv[optind]); optind++) { if (!all) { @@ -261,7 +260,7 @@ main (int argc, char **argv) if (!mail) { fprintf (stderr, "%s: unable to load mailbox\n", box->path); - continue; + goto cleanup; } imap = imap_open (box, fast ? mail->maxuid + 1 : 1, imap); @@ -269,7 +268,7 @@ main (int argc, char **argv) { fprintf (stderr, "%s: skipping mailbox due to IMAP error\n", box->path); - continue; + goto cleanup; } if (!quiet) @@ -313,6 +312,10 @@ main (int argc, char **argv) } maildir_close (mail); + +cleanup: + if (all) + box = box->next; } /* gracefully close connection to the IMAP server */