Commit b48ac923 b48ac923058cb1967209ee2883d93d55932a0364 by Sergey Poznyakoff

Bugfix

* configure.ac: Version 2.99.992
* NEWS: Update.
* libmailutils/opt/opt.c (add_option_cache): Use opt_default if
no argument is given.
1 parent a6bd9b68
GNU mailutils NEWS -- history of user-visible changes. 2016-10-19
GNU mailutils NEWS -- history of user-visible changes. 2016-10-28
Copyright (C) 2002-2016 Free Software Foundation, Inc.
See the end of file for copying conditions.
Please send mailutils bug reports to <bug-mailutils@gnu.org>.
Version 2.99.991 (Git)
Version 2.99.992 (Git)
This version is a major rewrite of GNU Mailutils. Quite a few parts
of the basic framework were rewritten from scratch, while some others
......
......@@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU General Public License along
dnl with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ(2.63)
AC_INIT([GNU Mailutils], [2.99.991], [bug-mailutils@gnu.org], [mailutils],
AC_INIT([GNU Mailutils], [2.99.992], [bug-mailutils@gnu.org], [mailutils],
[http://mailutils.org])
AC_CONFIG_SRCDIR([libmailutils/mailbox/mailbox.c])
AC_CONFIG_AUX_DIR([build-aux])
......
......@@ -148,7 +148,10 @@ add_option_cache (struct mu_parseopt *po, struct mu_option *opt,
char const *arg)
{
struct mu_option_cache *cache = mu_alloc (sizeof (*cache));
cache->cache_opt = opt;
if (arg == NULL && opt->opt_default)
arg = opt->opt_default;
cache->cache_arg = arg;
if ((po->po_flags & MU_PARSEOPT_IMMEDIATE)
......@@ -749,6 +752,9 @@ mu_option_set_value (struct mu_parseopt *po, struct mu_option *opt,
if (arg == NULL)
{
if (opt->opt_default)
/* The default value has been already assigned in add_option_cache.
This conditional is here in case mu_option_set_value is called
from the user code. */
arg = opt->opt_default;
else if (opt->opt_arg == NULL)
arg = "1";
......