zsh-workers
 help / color / mirror / code / Atom feed
From: "arno." <arno.@no-log.org>
To: zsh-workers@sunsite.dk
Subject: bug : _make and special parameters
Date: Wed, 8 Nov 2006 20:42:49 +0100	[thread overview]
Message-ID: <20061108194249.GA8389@localhost.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]

Hi,
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 don't known if there could be drawbacks with my fix, but I still send 
it.

arno.


? _make.patch
Index: Completion/Unix/Command/_make
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_make,v
retrieving revision 1.17
diff -u -r1.17 _make
--- Completion/Unix/Command/_make	9 Feb 2006 14:51:32 -0000	1.17
+++ Completion/Unix/Command/_make	8 Nov 2006 19:31:11 -0000
@@ -60,6 +60,7 @@
 	    var=${input%%[ $TAB]#=*}
 	    val=${input#*=}
 	    val=${val##[ $TAB]#}
+       local -h $var
 	    eval $var=\$val
 	    ;;
 	([[:alnum:]][[:alnum:]_]#[ $TAB]#:=*)
@@ -67,6 +68,7 @@
 	    val=${input#*=}
 	    val=${val##[ $TAB]#}
 	    val=$(expandVars 10 $val)
+       local -h $var
 	    eval $var=\$val
 	    ;;
 	([[:alnum:]][^$TAB:=]#:[^=]*)

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2006-11-08 19:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-08 19:42 arno. [this message]
2006-11-09 10:50 ` Peter Stephenson
2006-11-10  9:56   ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061108194249.GA8389@localhost.localdomain \
    --to="arno."@no-log.org \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).