summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-12-11 20:47:54 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-12-11 20:47:54 +0000
commit5076853c4f16d4fe214b8da52801689e581854cf (patch)
tree6714e85cf65ba257075e9cda206d1ecd92c96f8c /main.c
parente40c292b12f94320384788fd095432ebe93552f5 (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.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/main.c b/main.c
index 191d374c..145f4399 100644
--- a/main.c
+++ b/main.c
@@ -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);