Mercurial > dovecot > core-2.2
changeset 20394:0993d4b55bc8
doveadm: Fixed --long-parameters handling
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Tue, 21 Jun 2016 18:30:20 +0300 |
parents | 53ba3feb039a |
children | d4ea7744872f |
files | src/doveadm/doveadm-cmd.c |
diffstat | 1 files changed, 4 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/doveadm/doveadm-cmd.c Mon Jun 20 20:06:38 2016 +0300 +++ b/src/doveadm/doveadm-cmd.c Tue Jun 21 18:30:20 2016 +0300 @@ -378,18 +378,17 @@ { for(size_t i=0; par[i].name != NULL; i++) { struct option longopt; + + memset(&longopt, 0, sizeof(longopt)); longopt.name = par[i].name; - longopt.flag = 0; - longopt.val = 0; if (par[i].short_opt != '\0') { longopt.val = par[i].short_opt; str_append_c(shortopts, par[i].short_opt); if (par[i].type != CMD_PARAM_BOOL) str_append_c(shortopts, ':'); - } else { - if (par[i].type != CMD_PARAM_BOOL) longopt.has_arg = 1; - else longopt.has_arg = 0; } + if (par[i].type != CMD_PARAM_BOOL) + longopt.has_arg = 1; array_append(longopts, &longopt, 1); } array_append_zero(longopts);