diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1998-12-11 20:47:54 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1998-12-11 20:47:54 +0000 |
commit | 5076853c4f16d4fe214b8da52801689e581854cf (patch) | |
tree | 6714e85cf65ba257075e9cda206d1ecd92c96f8c /main.c | |
parent | e40c292b12f94320384788fd095432ebe93552f5 (diff) |
Bail out with a text-based error message if a non-existing mailbox
is given as a -f command line argument.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -342,6 +342,7 @@ int main (int argc, char **argv) int flags = 0; int version = 0; int i; + int explicit_folder = 0; extern char *optarg; extern int optind; @@ -382,6 +383,7 @@ int main (int argc, char **argv) case 'f': strfcpy (folder, optarg, sizeof (folder)); + explicit_folder = 1; break; case 'b': @@ -673,11 +675,16 @@ int main (int argc, char **argv) mutt_folder_hook (folder); - Context = mx_open_mailbox (folder, ((flags & M_RO) || option (OPTREADONLY)) ? M_READONLY : 0, NULL); - mutt_index_menu (); - if (Context) - safe_free ((void **)&Context); - mutt_endwin (NULL); + if((Context = mx_open_mailbox (folder, ((flags & M_RO) || option (OPTREADONLY)) ? M_READONLY : 0, NULL)) + || !explicit_folder) + { + mutt_index_menu (); + if (Context) + safe_free ((void **)&Context); + mutt_endwin (NULL); + } + else + mutt_endwin (Errorbuf); } exit (0); |