Commit e7a6f1b3 e7a6f1b394927aca592c4183e9ec2b7cd0656555 by Sergey Poznyakoff

Make sure -nodraftfolder cancels Draft-Folder variable, not only -draftfolder option.

1 parent 0c2ca624
......@@ -86,6 +86,11 @@ opt_handler (int key, char *arg, void *unused, struct argp_state *state)
{
switch (key)
{
case ARGP_KEY_INIT:
wh_env.draftfolder = mh_global_profile_get ("Draft-Folder",
mu_folder_directory ());
break;
case ARG_BUILD:
build_only = 1;
break;
......@@ -209,10 +214,6 @@ main (int argc, char **argv)
mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
opt_handler, NULL, &index);
if (!wh_env.draftfolder)
wh_env.draftfolder = mh_global_profile_get ("Draft-Folder",
mu_folder_directory ());
wh_env.file = mh_expand_name (wh_env.draftfolder, "comp", 0);
if (!wh_env.draftfile)
wh_env.draftfile = mh_expand_name (wh_env.draftfolder, "draft", 0);
......
......@@ -121,6 +121,11 @@ opt_handler (int key, char *arg, void *unused, struct argp_state *state)
{
switch (key)
{
case ARGP_KEY_INIT:
wh_env.draftfolder = mh_global_profile_get ("Draft-Folder",
mu_folder_directory ());
break;
case ARG_ANNOTATE:
annotate = is_true (arg);
break;
......@@ -427,10 +432,6 @@ main (int argc, char **argv)
mbox = mh_open_folder (current_folder, 0);
mh_msgset_parse (mbox, &msgset, argc, argv, "cur");
if (!wh_env.draftfolder)
wh_env.draftfolder = mh_global_profile_get ("Draft-Folder",
mu_folder_directory ());
wh_env.file = mh_expand_name (wh_env.draftfolder, "forw", 0);
if (!wh_env.draftfile)
wh_env.draftfile = mh_expand_name (wh_env.draftfolder, "draft", 0);
......
......@@ -142,6 +142,11 @@ opt_handler (int key, char *arg, void *unused, struct argp_state *state)
switch (key)
{
case ARGP_KEY_INIT:
wh_env.draftfolder = mh_global_profile_get ("Draft-Folder",
mu_folder_directory ());
break;
case ARG_ANNOTATE:
annotate = is_true (arg);
break;
......@@ -376,6 +381,7 @@ main (int argc, char **argv)
mu_init_nls ();
mu_argp_init (program_version, NULL);
mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
opt_handler, NULL, &index);
if (mh_format_parse (format_str, &format))
......@@ -384,10 +390,6 @@ main (int argc, char **argv)
exit (1);
}
if (!wh_env.draftfolder)
wh_env.draftfolder = mh_global_profile_get ("Draft-Folder",
mu_folder_directory ());
mbox = mh_open_folder (current_folder, 0);
mh_msgset_parse (mbox, &msgset, argc - index, argv + index, "cur");
if (msgset.count != 1)
......