diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2017-05-31 13:56:44 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2017-05-31 14:05:23 +0300 |
commit | 744c4a9c94064a0dae7d2ed8237ac8129e65510c (patch) | |
tree | 8fd02a623f6ce0ac49eefc5fb9dddb37520c7483 /mh/repl.c | |
parent | a79ec559859084cfe8a357bf9076d472fefbeeee (diff) | |
download | mailutils-744c4a9c94064a0dae7d2ed8237ac8129e65510c.tar.gz mailutils-744c4a9c94064a0dae7d2ed8237ac8129e65510c.tar.bz2 |
Fix MH initialization order
Calls to mh_global_profile_get and similar functions must appear
only after a call to mh_getopt (more properly, after mh_init and
mh_init2 are callead). This sequence was inadvertently changed
by commit e267ac86, due to which comp, forw, repl and burst stopped
reading important information from .mh_profile. Bug spotted by
Pierre-Jean.
* mh/burst.c: Make sure profile variables are accessed after
the profile is read.
* mh/comp.c: Likewise.
* mh/forw.c: Likewise.
* mh/repl.c: Likewise.
* mh/mh.h (mh_whatnow_env_from_environ): Split into two functions:
mh_whatnow_env_from_environ_early, to be called before mh_getopt,
and mh_whatnow_env_from_environ_late, to be called after it.
* mh/whatnowenv.c: Ditto.
* mh/whatnow.c: Call these two in the right order.
* THANKS: Update.
Diffstat (limited to 'mh/repl.c')
-rw-r--r-- | mh/repl.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -294,12 +294,15 @@ main (int argc, char **argv) { int rc; - draftfolder = mh_global_profile_get ("Draft-Folder", NULL); - whatnowproc = mh_global_profile_get ("whatnowproc", NULL); - mh_getopt (&argc, &argv, options, MH_GETOPT_DEFAULT_FOLDER, args_doc, prog_doc, NULL); + if (!draftfolder) + draftfolder = mh_global_profile_get ("Draft-Folder", NULL); + if (!whatnowproc) + whatnowproc = mh_global_profile_get ("whatnowproc", NULL); + + if (!format_str) format_str = default_format_str; |