Don't erase all long opts with complete -e

When using `complete -c foo -l bar -e`, all long options for the command
were being erased because it was also comparing the short option, which
was 0.
This commit is contained in:
Kevin Ballard 2014-09-02 14:51:40 -07:00
parent 1d9886d0f7
commit aa7fe3b132

View file

@ -630,7 +630,8 @@ bool completion_entry_t::remove_option(wchar_t short_opt, const wchar_t *long_op
for (option_list_t::iterator iter = this->options.begin(); iter != this->options.end();)
{
complete_entry_opt_t &o = *iter;
if (short_opt==o.short_opt || (long_opt && long_opt == o.long_opt))
if ((short_opt && short_opt == o.short_opt) ||
(long_opt && long_opt == o.long_opt))
{
/* fwprintf( stderr,
L"remove option -%lc --%ls\n",