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

Re: bug : _make and special parameters

> I downloaded qiv sources, went in the right directory, typed "make" and
> <TAB>
> I got the error :  (eval):1: read-only variable: CURSOR
> This is because in _make, Makefile lines are parsed to find for
> variables declarations, and then assigned with :
> eval $var=\$val
> But in qiv Makefile, there is the line :
> CURSOR = 84
> and CURSOR is a parameter special in zsh.
> That problem could happen with any special parameters.
> I found a solution by adding the line
> typeset -h $var
> just before eval

I think you've got the right sort of idea.  However, parseMakefile can
run recursively, because it handles include declarations, so the
variables need to go in the top-level namespace.  There's no easy way of
ensuring this, unfortunately, since there's no way of making the
parameter local (necessary since the global parameter is special) but at
a particular level.  So I'll commit your patch for now.

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070

To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

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