Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug#236350: zsh: _prefix completer broken?



On Mar 6,  5:38pm, Bart Schaefer wrote:
} Subject: Re: Bug#236350: zsh: _prefix completer broken?
}
} schaefer<504> egrefoo
} No matches for `external command', `builtin command', `shell function',
} `alias', `suffix alias', `reserved word', `job', `parameter', `local
} directory', `directory in cdpath', or `corrections'
} 
} : _main_complete:159:for for elif-then; ret=0 
} : _main_complete:160:for for elif-then; break 2  <-- doesn't happen in 4.0.7
} : _main_complete:169; curcontext=::: 
} : _main_complete:170; nm=0 

This looks like it could be a serious problem.  The code in question is
this:

    if [[ -n "$call" ]]; then
      if "${(@)argv[3,-1]}"; then
        ret=0
        break 2
      fi
    elif "$tmp"; then
      ret=0
      break 2
    fi

_approximate is being called as "$tmp" here.  It returns 1, but the
test succeeds and breaks out of the loop, because _approximate uses
"trap 'unfunction compadd' EXIT INT" and the return code of the trap
is being propagated rather than the return code of _approximate.



Messages sorted by: Reverse Date, Date, Thread, Author