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

Re: zrecompile -p -R/-M has no effect



On Thu, Sep 24, 2015 at 5:03 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Sep 23, 11:36pm, Mikael Magnusson wrote:
> } Subject: zrecompile -p -R/-M has no effect
> }
> } % zcompile() { >&2 echo -E - zcompile "$@"; builtin zcompile "$@" }
> } % touch .zshrc; zrecompile -p -R .zshrc
> } zcompile -t .zshrc.zwc
> } re-compiling .zshrc.zwc: zcompile .zshrc.zwc .zshrc
> } succeeded
> }
> } It ate my -R.
>
> It looks (set -x) as though the first "getops :tqp opt" loop is
> consuming the -R and passing it through the the (*) branch which
> stashes it in $tmp, which is then used to shift it off $argv at
> the end of the loop.
>
> The shift expression (line 55) is
>
>     shift OPTIND-${#tmp:-1}
>
> I suspect it needs to be
>
>     shift OPTIND-${#tmp}-1
>
> Anyone care to confirm?

This fixes it for me, and doesn't appear to break anything else in the
process. Thanks!

-- 
Mikael Magnusson



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