Fixed return status when the mailbox does not exist.
Showing
1 changed file
with
4 additions
and
2 deletions
... | @@ -353,14 +353,15 @@ main(int argc, char **argv) | ... | @@ -353,14 +353,15 @@ main(int argc, char **argv) |
353 | 353 | ||
354 | mailbox_get_url (mbox, &url); | 354 | mailbox_get_url (mbox, &url); |
355 | if (status == ENOENT) | 355 | if (status == ENOENT) |
356 | status = 2; | 356 | goto cleanup1; |
357 | else | 357 | else { |
358 | fprintf (stderr, "could not open mailbox %s: %s\n", | 358 | fprintf (stderr, "could not open mailbox %s: %s\n", |
359 | url_to_string (url), | 359 | url_to_string (url), |
360 | mu_errstring(status)); | 360 | mu_errstring(status)); |
361 | 361 | ||
362 | goto cleanup; | 362 | goto cleanup; |
363 | } | 363 | } |
364 | } | ||
364 | 365 | ||
365 | if (! be_quiet) | 366 | if (! be_quiet) |
366 | { | 367 | { |
... | @@ -396,6 +397,7 @@ cleanup: | ... | @@ -396,6 +397,7 @@ cleanup: |
396 | return 3; | 397 | return 3; |
397 | } | 398 | } |
398 | 399 | ||
400 | cleanup1: | ||
399 | if (show_summary) | 401 | if (show_summary) |
400 | printf ("You have %d messages\n", total); | 402 | printf ("You have %d messages\n", total); |
401 | if (show_query && have_new_mail) | 403 | if (show_query && have_new_mail) | ... | ... |
-
Please register or sign in to post a comment